Combination SumCombination Sum Total Accepted: 25850 Total Submissions: 96391 My Submissions Question Solution Given a set of candidate numbers (C) an...
分类:
其他好文 时间:
2014-12-03 21:15:19
阅读次数:
163
Letter Combinations of a Phone NumberGiven a digit string, return all possible letter combinations that the number could represent.A mapping of digit ...
分类:
其他好文 时间:
2014-12-03 21:12:18
阅读次数:
188
PermutationsGiven a collection of numbers, return all possible permutations.For example,[1,2,3] have the following permutations:[1,2,3], [1,3,2], [2,1...
分类:
其他好文 时间:
2014-12-03 21:08:41
阅读次数:
111
Permutations IIGiven a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2] have the follo...
分类:
其他好文 时间:
2014-12-03 20:58:01
阅读次数:
185
CombinationsGiven two integers n and k, return all possible combinations of k numbers out of 1 ... n.For example,If n = 4 and k = 2, a solution is:[ [...
分类:
其他好文 时间:
2014-12-03 20:46:09
阅读次数:
164
·网上说是区间dp,但不是很懂;·看了别人的解题报告与代码,感觉跟分治比较像解释: dp[i][j] 表示 杀从第i头狼到第j头狼所获得的最小伤害; for(int i=l+1;i 2 #include 3 #include 4 #include 5 #include 6 #includ...
分类:
其他好文 时间:
2014-12-03 18:51:15
阅读次数:
165
今天CSDN博客发生异常,折腾了大半天终于发出了这篇博文。
【题目】
Given a binary tree, determine if it is a valid binary search tree (BST).
Assume a BST is defined as follows:
The left subtree of a node contains only no...
分类:
其他好文 时间:
2014-12-03 17:14:52
阅读次数:
219
Reverse Words in a String Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".clic...
分类:
其他好文 时间:
2014-12-03 17:02:11
阅读次数:
208
题目网址:https://oj.leetcode.com/problems/two-sum/题目描述:Given an array of integers, find two numbers such that they add up to a specific target number.The ...
分类:
其他好文 时间:
2014-12-03 14:07:05
阅读次数:
161
详细解题报告可以看这个PPT这题如果是直接开int 5000 * 5000 的空间肯定会MLE,优化方法是采用滚动数组。原LCS转移方程 :dp[i][j] = dp[i - 1][j] + dp[i][j -1]因为 dp[i][j] 只依赖于 dp[i - 1][j] 和 dp[i][j - ....
分类:
编程语言 时间:
2014-12-02 23:54:27
阅读次数:
175