Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the leng ...
分类:
其他好文 时间:
2016-12-04 00:13:41
阅读次数:
187
Leetcode C#, Hash Map, Two pointers ...
Analysis: Given a string s, find out all chars that are invalid (i.e., count < k). The longest substring must reside in one of the substrings divided ...
分类:
其他好文 时间:
2016-12-01 14:23:42
阅读次数:
172
Time Complexity: O(N) The depth of the directory/file is calculated by counting how many "\t"s are there.The time complexity is O(n) because each subs ...
分类:
其他好文 时间:
2016-11-30 07:47:50
阅读次数:
187
Sum of Consecutive Prime Numbers Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 23931 Accepted: 13044 Description Some positive integers c ...
分类:
其他好文 时间:
2016-11-29 06:22:07
阅读次数:
182
Given a string, find the length of the longest substring T that contains at most 2 distinct characters. For example, Given s = “eceba”, T is "ece" whi ...
分类:
编程语言 时间:
2016-11-28 17:23:20
阅读次数:
269
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.寻找最长回文子串Example:Input: "babad" Outp... ...
分类:
其他好文 时间:
2016-11-27 19:17:51
阅读次数:
259
DP Solution similar to Longest Increasing Subsequence: 我的解法:用一个arraylist存以某一个element结尾的最长sequence 别人的好方法,大体思路一样,只是不存arraylist, 而用一个preIndex数组存以某一个elem ...
分类:
其他好文 时间:
2016-11-27 07:45:52
阅读次数:
177
LCS问题即longest common subsequence problem,中文:最长公共子序列问题 给你两个字符串str1和str2,它们之间可能存在公有子序列,子序列和子串的区别是:子序列不要求连续,只需要按照顺序出现就好,子串则要求连续: 例如:SIMPLE和NAIVE有共同的子序列IE ...
分类:
其他好文 时间:
2016-11-26 23:20:09
阅读次数:
328