# -*- coding:utf-8 -*-
class Solution:
def jumpFloor(self, number):
# write code here
a, b = 1, 1
while number > 0:
number -= 1
b = a + b
a = b - a
return a
# -*- coding:utf-8 -*-
class Solution:
def jumpFloor(self, number):
# write code here
a, b = 1, 1
while number > 0:
number -= 1
b = a + b
a = b - a
return a
本文标题:【递归循环】跳台阶
本文链接:https://www.haomeiwen.com/subject/djmgjctx.html
网友评论