you are climbing a stair case it takes steps number of steps to reach to the top each time you can either climb 1 or 2 steps in how many distinct ways can you climb to the top note given argument steps will be a positive integer on space type steps int rtype int the above function can be optimized as o1 space type steps int rtype int o n space type steps int rtype int the above function can be optimized as o 1 space type steps int rtype int
def climb_stairs(steps):
    
    arr = [1, 1]
    for _ in range(1, steps):
        arr.append(arr[-1] + arr[-2])
    return arr[-1]





def climb_stairs_optimized(steps):
    
    a_steps = b_steps = 1
    for _ in range(steps):
        a_steps, b_steps = b_steps, a_steps + b_steps
    return a_steps