给定一个整数序列,求解一个子序列,子序列之和等于给定目标值。子序列满足以下条件:
1)子序列是有序的
2)子序列的元素个数不限,可以是给定元素的重复元素。
3)结果中的子序列是唯一的
原题描述如下:
Given a set of candidate numbers (C) and a target number (T), find all unique combinations ...
                            
                            
                                分类:
其他好文   时间:
2014-06-11 06:26:03   
                                阅读次数:
302
                             
                         
                    
                        
                            
                            
                                题目:Maximum Depth of Binary TreeGiven a binary tree, 
find its maximum depth.The maximum depth is the number of nodes along the 
longest path from the ro...
                            
                            
                                分类:
其他好文   时间:
2014-06-10 10:09:13   
                                阅读次数:
237
                             
                         
                    
                        
                            
                            
                                Givennpoints on a 2D plane, find the maximum 
number of points that lie on the same straight 
line.每次固定一个点,然后遍历所有其它点,记录每种斜率出现的次数。需要考虑两种特殊情况:斜率不存在和点与固定点重...
                            
                            
                                分类:
其他好文   时间:
2014-06-10 08:44:57   
                                阅读次数:
164
                             
                         
                    
                        
                            
                            
                                戳我去解题Write a function to find the longest 
common prefix string amongst an array of strings.class Solution {public: string 
longestCommonPrefix(vecto...
                            
                            
                                分类:
其他好文   时间:
2014-06-10 08:29:55   
                                阅读次数:
189
                             
                         
                    
                        
                            
                            
                                一次总结两道题,两道题目都比较基础Description:Write a function to 
find the longest common prefix string amongst an array of strings.分析: 
这道题目最重要的知道什么叫prefix前缀, 否则一不小心就做...
                            
                            
                                分类:
其他好文   时间:
2014-06-09 21:08:16   
                                阅读次数:
224
                             
                         
                    
                        
                            
                            
                                Given an infinite number of quarters (25 cents), 
dimes (10 cents), nickels (5 cents) and pennies (1 cent), find how many ways to 
represent n cents.思路:...
                            
                            
                                分类:
其他好文   时间:
2014-06-09 20:04:56   
                                阅读次数:
238
                             
                         
                    
                        
                            
                            
                                原题地址:https://oj.leetcode.com/problems/combination-sum/题意:Given 
a set of candidate numbers (C) and a target number (T), find all unique 
combinations in...
                            
                            
                                分类:
编程语言   时间:
2014-06-09 17:50:09   
                                阅读次数:
333
                             
                         
                    
                        
                            
                            
                                You are given a string, S, and a list of words, 
L, that are all of the same length. Find all starting indices of substring(s) in 
S that is a concatena...
                            
                            
                                分类:
其他好文   时间:
2014-06-09 17:49:34   
                                阅读次数:
240
                             
                         
                    
                        
                            
                            
                                原题地址:https://oj.leetcode.com/problems/first-missing-positive/题意:Given 
an unsorted integer array, find the first missing positive integer.For 
example,G...
                            
                            
                                分类:
编程语言   时间:
2014-06-09 17:44:43   
                                阅读次数:
980
                             
                         
                    
                        
                            
                            
                                原题地址:https://oj.leetcode.com/problems/combination-sum-ii/题意:Given 
a collection of candidate numbers (C) and a target number (T), find all unique 
combi...
                            
                            
                                分类:
编程语言   时间:
2014-06-09 17:41:58   
                                阅读次数:
320