Find total in - degree and out - degree
for i in range ( 1 , N ) : NEW_LINE INDENT if ( inDeg [ i ] == 1 ) : NEW_LINE INDENT totalIndegree += 1 ; NEW_LINE DEDENT if ( outDeg [ i ] == 1 ) : NEW_LINE INDENT totalOutdegree += 1 ; NEW_LINE DEDENT DEDENT