Dynamic Programming
文章平均质量分 65
boegkpmlkvebevwa
这个作者很懒,什么都没留下…
展开
-
[LeetCode] Maximum Subarray
Total Accepted: 11866 Total Submissions: 36548 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原创 2014-04-02 15:33:27 · 533 阅读 · 0 评论 -
[LeetCode] Minimum Path Sum
Total Accepted: 9358 Total Submissions: 30791 Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its pat原创 2014-05-05 18:28:50 · 382 阅读 · 0 评论 -
[LeetCode] Triangle
Total Accepted: 8954 Total Submissions: 33737 Given 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 foll原创 2014-04-21 12:36:39 · 406 阅读 · 0 评论 -
[LeetCode] 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 public class Solution { publ原创 2014-04-08 15:20:34 · 386 阅读 · 0 评论 -
[LeetCode] Pascal's Triangle II
Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3, Return [1,3,3,1]. Note: Could you optimize your algorithm to use only O(k) extra space?原创 2014-04-08 16:00:14 · 414 阅读 · 0 评论 -
[LeetCode] Unique Paths
Total Accepted: 9992 Total Submissions: 32850 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 poi原创 2014-04-23 12:00:42 · 362 阅读 · 0 评论 -
[LeetCode] Palindrome Partitioning
Total Accepted: 9269 Total Submissions: 36157 Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. Fo原创 2014-04-23 11:04:29 · 545 阅读 · 0 评论 -
[LeetCode] Unique Paths II
Total Accepted: 7514 Total Submissions: 27719 Follow up for "Unique Paths": Now consider if some obstacles are added to the grids. How many unique paths would there be? An obstacle and empty space原创 2014-04-23 12:13:58 · 381 阅读 · 0 评论 -
[LeetCode] Palindrome Partitioning II
Total Accepted: 7469 Total Submissions: 43163 Given a string s, partition s such that every substring of the partition is a palindrome. Return the minimum cuts needed for a palindrome partit原创 2014-04-24 17:55:20 · 312 阅读 · 0 评论