10min 边界测试。0,1,2
class Solution:
def rectCover(self, number):
# write code here
dp=[0 for i in range(number+1)]
if number>0: dp[1]=1
if number>1: dp[2]=2
for i in range(3,number+1):
dp[i]=dp[i-1]+dp[i-2]
return dp[number]
网友评论