class Solution: # @param n, an integer # @return an integer def climbStairs(self, n): if n<2: return 1 step1=1 step2=1 for i in range(2,n+1): temp1=step1+step2 step2=step1 step1=temp1 return step1
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment