Dynamic Programming
文章平均质量分 76
jialuyyy
这个作者很懒,什么都没留下…
展开
-
Best Time to Buy and Sell Stock I, II
Best Time to Buy and Sell Stock ISay 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 transacti原创 2015-06-19 05:34:50 · 286 阅读 · 0 评论 -
Edit Distance
Edit DistanceGiven two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)You have the following 3 op原创 2015-07-01 21:53:40 · 293 阅读 · 0 评论 -
Best Time to Buy and Sell Stock III
Best Time to Buy and Sell Stock IIISay you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may co原创 2015-07-04 12:00:06 · 280 阅读 · 0 评论 -
House Robber II
House Robber IINote: This is an extension of House Robber.After robbing those houses on that street, the thief has found himself a new place for his thievery so that he will not ge原创 2015-06-30 04:30:17 · 209 阅读 · 0 评论 -
House Robber
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 o原创 2015-06-30 04:10:55 · 221 阅读 · 0 评论 -
Jump Game
Jump GameGiven an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that原创 2015-06-21 22:42:38 · 154 阅读 · 0 评论 -
Maximal Square
Maximal Square Given a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and return its area.For example, given the following matrix:1 0 1 0 01 0 1 1原创 2015-06-08 00:10:11 · 181 阅读 · 0 评论 -
Maximum Product Subarray
Maximum Product Subarray Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array [2,3,-2,4],the contiguou原创 2015-06-05 02:25:45 · 188 阅读 · 0 评论 -
Triangle
TriangleGiven a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the following triangle[原创 2015-06-21 05:01:54 · 194 阅读 · 0 评论 -
Maximum Subarray
Maximum Subarray Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [−2,1,−3,4,−1,2,1,−5,4],the contig原创 2015-06-21 05:25:26 · 289 阅读 · 0 评论 -
Distinct Subsequences
Distinct SubsequencesGiven a string S and a string T, count the number of distinct subsequences of T in S.A subsequence of a string is a new string which is formed from the origina原创 2015-07-01 23:23:17 · 233 阅读 · 0 评论