Please tell me what is wrong with this sanswer


  • 0
    R

    count=0
    n= int (input('number of stairs\n'))
    for i in range(0, n+1):
    for j in range(0, n+1):
    if 2*i + j == n: #i gives number two steps taken and j is no. of one step taken to reach the top
    print(i)
    print(j)
    count=count+1
    if (i!=0 and j!=0): # so that 2 one steps+ 1 two steps and 1 two steps and 2 one steps both cases are included
    count=count+1

    print (count)


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.