class Solution:
def findJudge(self, N: int, trust: List[List[int]]) -> int:
if N == 1: return 1
people = [0]*N
trusted = [0]*N
for i in range(len(trust)):
people[trust[i][0]-1] += 1
trusted[trust[i][1]-1] += 1
if N-1 in trusted and 0 in people and people.index(0) == trusted.index(N-1): return trusted.index(N-1)+1
return -1