动态规划
jyjkitty
这个作者很懒,什么都没留下…
展开
-
动态规划——Climbing Stairs(easy,python)
动态规划——Climbing Stairs(easy,python)题目n级台阶,一次跨1级台阶或者2级台阶,问最终能到有几种到达台阶顶的方案。解析当n<=0,0种方案,不需要走 当n = 1,1种方案,走一步上去 当n = 2,2种方案,一步一步 or 一下子两步而对于第n级来说,假设n-1级,n-2级分别有 num[n-1],num[n-2], 则 n-1级到n级只能跨一级台阶,而n-2级到原创 2017-07-01 21:26:22 · 332 阅读 · 0 评论 -
动态规划 139 Word Break + 322 Coin Change
动态规划总结322. Coin ChangeYou are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you need to make up that amount. If原创 2017-07-15 11:26:55 · 273 阅读 · 0 评论