(n)
[summary]
    analog as above

    Arguments:
        n {[int]} -- [description]
    
    Returns:
        [list of lists] -- [all factors of n]
[summary]
    analog as above
[ summary ] analog as above
def get_factors_iterative2(n):
    """[summary]
    analog as above

    Arguments:
        n {[int]} -- [description]
    
    Returns:
        [list of lists] -- [all factors of n]
    """

    ans, stack, x = [], [], 2
    while True:
        if x > n // x:
            if not stack:
                return ans
            ans.append(stack + [n])
            x = stack.pop()
            n *= x
            x += 1
        elif n % x == 0:
            stack.append(x)
            n //= x
        else:
            x += 1
def get_factors_iterative2 ( n ) : ans , stack , x = [ ] , [ ] , 2 while True : if x > n // x : if not stack : return ans ans . append ( stack + [ n ] ) x = stack . pop ( ) n *= x x += 1 elif n % x == 0 : stack . append ( x ) n //= x else : x += 1