class Solution: def CalulateMethodCount(self, num_money): # write code here if num_money<=0: return 0 A = [0 for i in range(num_money+1)] A[0]=1 for i in range(1, num_money+1, 1): for j in range(1, 4, 1): if i>=j: A[i] = A[i]+A[i-j] return A[num_money]
全部评论
(3) 回帖