Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two ...
分类:
其他好文 时间:
2016-12-05 07:48:18
阅读次数:
204
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
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
[POJ3096]Surprising Strings 试题描述 The D-pairs of a string of letters are the ordered pairs of letters that are distance D from each other. A string is ...
分类:
其他好文 时间:
2016-11-27 06:52:40
阅读次数:
194