Find a person with indegree n - 1 and out degree 0
for i in range ( n ) : NEW_LINE INDENT if ( indegree [ i ] == n - 1 and outdegree [ i ] == 0 ) : NEW_LINE INDENT return i NEW_LINE DEDENT DEDENT return - 1 NEW_LINE