n residents numbered from 1 to n. Rumor has it that one of them is an **arbiter**: someone who trusts nobody, yet is trusted by every other resident.
You get a list trusts where trusts[i] = [a, b] means resident a trusts resident b. No other trust relations exist.
Return the arbiter's number, or -1 if there is no such person.n=4, trusts=[[1, 2], [3, 2], [4, 2], [4, 1]] → 2
All three others trust person 2, and person 2 trusts nobody.
n=3, trusts=[[1, 3], [2, 3], [3, 2]] → -1
Person 3 is trusted by everyone else, but trusts person 2.
n=2, trusts=[] → -1
trusts are distinctn=4, trusts=[[1, 2], [3, 2], [4, 2], [4, 1]]
2
Run checks the first 3 tests in your browser. Submit checks all 89 tests on the server, hidden ones included.