visited array for dfs
vis = [ 0 for i in range ( n ) ] NEW_LINE for i in range ( n ) : NEW_LINE INDENT if ( vis [ i ] == False ) : NEW_LINE INDENT answer = max ( answer , dfs ( i , adj , vis ) ) NEW_LINE DEDENT DEDENT return answer NEW_LINE