In a town of n people labelled 1 to n, there might be a secret judge. If there is one: the judge trusts nobody, and everybody else trusts the judge. There is exactly one person who fits both rules, or no one.
trust is an array of pairs [a, b] meaning person a trusts person b. Return the judge's label, or -1 if there is no judge.
- This is a directed graph:
a -> b adds one to the in-degree of b and one to the out-degree of a - A town of one person with no trust pairs has its single person as judge
- Aim for O(n + trust.length) time, without building adjacency lists