<qiyuangong>997_Find_The_Town_Judge_1.py
def findJudge( N: int, trust: List[List[int]]) -> int:
    if N==1:
        return 1
    d1={}
    d2={}
    for i, j in trust:
        if j in d1:
            d1[j]+=1
        else:
            d1[j]=1
        if i in d2:
            d2[i]+=1
        else:
            d2[i]=1
    for i,j in d1.items():
        if j==N-1:
            if i not in d2:
                return i
    return -1
def sample_funcname ( var_0 : int , var_2 : List [ List [ int ] ] ) -> int :
    if var_0 == 1 :
        return 1
    var_5 = { }
    var_6 = { }
    for var_7 , var_8 in var_2 :
        if var_8 in var_5 :
            var_5 [ var_8 ] += 1
        else :
            var_5 [ var_8 ] = 1
        if var_7 in var_6 :
            var_6 [ var_7 ] += 1
        else :
            var_6 [ var_7 ] = 1
    for var_7 , var_8 in var_5.items ( ) :
        if var_8 == var_0 - 1 :
            if var_7 not in var_6 :
                return var_7
    return - 1
