class Solution:
def jump(self,n):
if n ==0:
return 0
elif n==1:
return 1
elif n ==1:
return 2
numN = 0
first = 1
second = 2
for i in range(3,n+1):
numN = first+second
first = second
second = numN
return numN
if __name__ ==‘__main__‘:
solution = Solution()
time = solution.jump(5)
print(time)
原文:https://www.cnblogs.com/turningli/p/12445913.html