DP
文章平均质量分 57
Juxin_Lin
这个作者很懒,什么都没留下…
展开
-
【LeetCode】70. Climbing Stairs
Difficulty: EasyYou 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?Su原创 2016-10-25 21:12:03 · 254 阅读 · 0 评论 -
【LeetCode】120. Triangle
Difficulty: MediumGiven 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[原创 2016-11-01 21:48:39 · 200 阅读 · 0 评论 -
【LeetCode】322. Coin Change
Difficulty: MediumYou 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.原创 2016-11-01 20:35:07 · 277 阅读 · 0 评论 -
【LeetCode】96. Unique Binary Search Trees
Difficulty: MediumGiven n, how many structurally unique BST's (binary search trees) that store values 1...n?For example,Given n = 3, there are a total of 5 unique BST's. 1 3原创 2016-11-01 19:56:17 · 190 阅读 · 0 评论 -
【LeetCode】392. Is Subsequence
Difficulty: MediumGiven a string s and a string t, check if s is subsequence of t.You may assume that there is only lower case English letters in both s and t. t is potentially a very long (原创 2016-11-01 17:36:41 · 303 阅读 · 0 评论 -
【LeetCode】416. Partition Equal Subset Sum
Difficulty: MediumGiven a non-empty array containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elements in both subsets is equal.Note原创 2016-11-01 16:48:53 · 229 阅读 · 0 评论 -
【LeetCode】300. Longest Increasing Subsequence
Difficulty: MediumGiven an unsorted array of integers, find the length of longest increasing subsequence.For example,Given [10, 9, 2, 5, 3, 7, 101, 18],The longest increasing subsequence原创 2016-10-20 12:09:14 · 347 阅读 · 0 评论 -
【LeetCode】121. Best Time to Buy and Sell Stock
Difficulty: EasySay 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 (ie, buy one and sell原创 2016-10-20 15:41:43 · 228 阅读 · 0 评论 -
【LeetCode】303. Range Sum Query - Immutable
Difficulty: EasyGiven an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive.Example:Given nums = [-2, 0, 3, -5, 2, -1]sumRange(0, 2) -> 1sum原创 2016-10-25 21:49:12 · 248 阅读 · 0 评论 -
【LeetCode】53. 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 contiguous subarray [4,-1,2,1] ha原创 2017-01-08 10:42:39 · 318 阅读 · 0 评论