
动态规划
Kelly Fu
这个作者很懒,什么都没留下…
展开
-
Climbing Stairs(70) - easy
70— Climbing Stairs You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? Note: Given n ...原创 2019-01-10 16:23:49 · 240 阅读 · 0 评论 -
Best Time to Buy and Sell Stock(121) - easy
121— Best Time to Buy and Sell Stock Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction (i.e., buy ...原创 2019-01-10 20:09:56 · 119 阅读 · 0 评论 -
House Robber(198) - easy
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 ...原创 2019-01-10 21:48:28 · 152 阅读 · 0 评论 -
Maximum Subarray(53) - easy
53— Maximum Subarray Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. Example1: Input: [-2,1,-3,4,-1,2,1,-5,4]...原创 2019-01-11 00:58:33 · 333 阅读 · 0 评论