The way I look at this is, the last step taken need not be considered because it is common to every way of climbing the stairs – you always step on the last step. So you only need to look at the number of ways of getting to a position from which you can reach the last step i.e. S(n-2)+S(n-1)
The way I look at this is, the last step taken need not be considered because it is common to every way of climbing the stairs – you always step on the last step. So you only need to look at the number of ways of getting to a position from which you can reach the last step i.e. S(n-2)+S(n-1)