动态规划
文章平均质量分 71
Yadoer
这个作者很懒,什么都没留下…
展开
-
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?第一反应,递归求解,貌似很简单。但是不幸,超时p原创 2015-02-05 20:25:40 · 3126 阅读 · 0 评论 -
LeetCode-Palindrome Partitioning
Given a string s, partition s such that every substring of the partition is a palindrome.Return all possible palindrome partitioning of s.For example, given s = "aab",Return [ ["aa","原创 2015-02-09 20:28:12 · 1016 阅读 · 0 评论 -
LeetCode-Word Break II
Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.For example, givens = "leetcode",dict = ["leet"原创 2015-03-13 20:56:46 · 1066 阅读 · 0 评论 -
LeetCode - Edit Distance
Given 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 operations permitted on a word:原创 2015-08-27 20:02:41 · 824 阅读 · 0 评论 -
LeetCode-Triangle
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 following triangle[ [2], [3,4], [原创 2015-08-27 14:34:47 · 892 阅读 · 0 评论 -
LeetCode-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 11 1 1 1 11 0 0 1 0原创 2015-08-27 17:45:34 · 860 阅读 · 0 评论 -
LeetCode-Interleaving String
Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.For example,Given:s1 = "aabcc",s2 = "dbbca",When s3 = "aadbbcbcac", return true.When s3 = "aadbbbaccc", ret原创 2015-08-28 17:48:18 · 1045 阅读 · 0 评论 -
LeetCode-Distinct Subsequences
Given 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 original string by deleting some (can be non原创 2015-08-28 15:21:03 · 935 阅读 · 0 评论