Dynamic Programming
所难
这个作者很懒,什么都没留下…
展开
-
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原创 2014-08-06 10:54:32 · 244 阅读 · 0 评论 -
LeetCode-Decode Ways
A message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message containing digits, determine the total nu原创 2014-08-07 15:52:08 · 315 阅读 · 0 评论 -
LeetCode-Scramble String
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representation of s1 = "great": great / \ gr原创 2014-08-08 12:12:02 · 426 阅读 · 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:原创 2014-08-10 16:31:40 · 240 阅读 · 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","原创 2014-07-31 10:27:37 · 259 阅读 · 0 评论 -
LeetCode-Palindrome Partitioning II
Given a string s, partition s such that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioning of s.For example, given s = "aab",Return原创 2014-07-30 13:36:12 · 247 阅读 · 0 评论 -
LeetCode-Word Break
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"原创 2014-07-29 15:43:50 · 386 阅读 · 0 评论 -
LeetCode-Word Break II
Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word.Return all such possible sentences.For example, givens = "原创 2014-07-29 15:37:05 · 539 阅读 · 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原创 2014-08-03 13:28:07 · 337 阅读 · 0 评论