给定一个可能包含重复整数的列表,返回所有可能的子集(幂集)。注意事项:解决方案集不能包含重复的子集。例如,如果 nums = [1,2,2],答案为:[ [2], [1], [1,2,2], [2,2], [1,2], []]详见:https://leetcode.com/problems/subs ...
                            
                            
                                分类:
其他好文   时间:
2018-04-04 14:57:29   
                                阅读次数:
225
                             
                    
                        
                            
                            
                                Given an unsorted array of integers, find the length of the longest consecutive elements sequence. For example,Given [100, 4, 200, 1, 3, 2],The longes ...
                            
                            
                                分类:
其他好文   时间:
2018-04-02 13:45:30   
                                阅读次数:
168
                             
                    
                        
                            
                            
                                    Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the leng ...
                            
                            
                                分类:
其他好文   时间:
2018-03-31 20:41:46   
                                阅读次数:
130
                             
                    
                        
                            
                            
                                两者的区别: 最长公共子串(Longest Common Substirng)和最长公共子序列(Longest Common Subsequence,LCS)的区别为:子串是串的一个连续的部分,子序列则是从不改变序列的顺序,而从序列中去掉任意的元素而获得新的序列;也就是说,子串中字符的位置必须是连续 ...
                            
                            
                                分类:
其他好文   时间:
2018-03-30 21:47:04   
                                阅读次数:
167
                             
                    
                        
                            
                            
                                    问题链接 "LeetCode 32. Longest Valid Parentheses" 题目解析 给出只包含左右括号的字符串,返回最长的括号匹配字符串长度。 解题思路 括号匹配问题一般借助 栈 ,便于理解。定义 $start$ 记录合法字符串的起始位置,遍历字符串: 当遇到左括号,则把其索引压入 ...
                            
                            
                                分类:
其他好文   时间:
2018-03-29 21:22:32   
                                阅读次数:
154
                             
                    
                        
                            
                            
                                    import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.core.Ordered; import javax.servlet.*; import javax.servlet.http.Ht... ...
                            
                            
                                分类:
其他好文   时间:
2018-03-29 14:57:19   
                                阅读次数:
1343
                             
                    
                        
                            
                            
                                Write a function to find the longest common prefix string amongst an array of strings. 题解: 简单的暴力遍历解决 ...
                            
                            
                                分类:
其他好文   时间:
2018-03-25 18:17:51   
                                阅读次数:
131
                             
                    
                        
                            
                            
                                Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example: Example: 题解: Solution 1 暴 ...
                            
                            
                                分类:
其他好文   时间:
2018-03-24 14:27:06   
                                阅读次数:
167
                             
                    
                        
                            
                            
                                1 题目 Given a string, find the length of the longest substring without repeating characters. 给定一个字符串,求该字符串的最长且不含有重复字符的子字符串。 Examples: Given "abcabcbb", ...
                            
                            
                                分类:
其他好文   时间:
2018-03-23 11:40:09   
                                阅读次数:
160
                             
                    
                        
                            
                            
                                    Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the leng ...
                            
                            
                                分类:
其他好文   时间:
2018-03-22 19:14:41   
                                阅读次数:
125