<doocs>2127.Maximum Employees to Be Invited to a Meeting_1.py
def max_cycle(fa):
    n = len(fa)
    vis = [False] * n
    ans = 0
    for i in range(n):
        if vis[i]:
            continue
        cycle = []
        j = i
        while not vis[j]:
            cycle.append(j)
            vis[j] = True
            j = fa[j]
        for k, v in enumerate(cycle):
            if v == j:
                ans = max(ans, len(cycle) - k)
                break
    return ans
def sample_funcname ( var_0 ) :
    var_2 = len ( var_0 )
    var_4 = [ False ] * var_2
    var_6 = 0
    for var_8 in range ( var_2 ) :
        if var_4 [ var_8 ] :
            continue
        var_9 = [ ]
        var_10 = var_8
        while not var_4 [ var_10 ] :
            var_9.append ( var_10 )
            var_4 [ var_10 ] = True
            var_10 = var_0 [ var_10 ]
        for var_14 , var_15 in enumerate ( var_9 ) :
            if var_15 == var_10 :
                var_6 = max ( var_6 , len ( var_9 ) - var_14 )
                break
    return var_6
