题解 | #跳台阶#
跳台阶
http://www.nowcoder.com/practice/8c82a5b80378478f9484d87d1c5f12a4
# -*- coding:utf-8 -*-
class Solution:
def jumpFloor(self, number):
# write code here
ans=[0,1,2]
for i in range(3,number+1):
ans.append(ans[i-1]+ans[i-2])
return ans[number]
题解-数据结构与算法 文章被收录于专栏
小菜鸟的题解