![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
动态规划
lyh_xd
一匹正在努力提高算法、编程水平的机器学习马
展开
-
Leetcode 62. Unique Paths
A robot is located at the top-left corner of a m x n grid (marked ‘Start’ in the diagram below).The robot can only move either down or right at any point in time. The robot is trying to reach the botto原创 2016-06-17 21:11:38 · 211 阅读 · 0 评论 -
leetcode 279 : Perfect Squares
Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, …) which sum to n. For example, given n = 12, return 3 because 12 = 4 + 4 + 4; given n = 13, retu原创 2016-03-29 21:45:34 · 428 阅读 · 0 评论 -
leetcode 70. Climbing Stairs
意思就是爬一个n个台阶的楼梯,每次只能爬1个或2个台阶,问有多少种方法。 思路:爬n个台阶可有两种大的方案:爬 n-2 个台阶后再一次爬 2 个台阶;或者爬 n-1 个台阶后再爬 1 个台阶。所以得出规律:设方案个数为 S[n],则 S[n]=S[n-1]+S[n-2],S[1]=1,S[2]= , 这是一个斐波那契数列。原创 2016-04-01 17:26:38 · 318 阅读 · 0 评论 -
leetcode 198. House Robber
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses原创 2016-04-09 14:52:54 · 228 阅读 · 0 评论 -
Leetcode 121. Best Time to Buy and Sell Stock
股票利益最大化问题原创 2016-05-25 17:32:38 · 204 阅读 · 0 评论