int findJudge(int N, int** trust, int trustSize, int* trustColSize){ int total=(N+1)*N/2,i; int hash[1001]={0}; for (i=0; i<trustSize; i++) { hash[trust[i][0]]=-1; if (hash[trust[i][1]]>=0) hash[trust[i][1]]+=trust[i][0]; } for (i=1; i<=N; i++) if (hash[i] != -1 && hash[i]+i == total) return i; return -1; }