The quesiton:Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must close in...
分类:
其他好文 时间:
2014-12-30 11:23:11
阅读次数:
176
Longest Substring with At Most Two Distinct CharactersGiven a string, find the length of the longest substring T that contains at most 2 distinct char...
分类:
其他好文 时间:
2014-12-28 16:53:21
阅读次数:
198
What to do when the Chinese Characters are messed up when extracting from zip archive?What to do when the Chinese Characters are messed up when extrac...
分类:
其他好文 时间:
2014-12-28 15:19:10
阅读次数:
143
Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string. If the last word...
分类:
移动开发 时间:
2014-12-27 23:03:14
阅读次数:
176
Longest Substring Without Repeating CharactersGiven a string, find the length of the longest substring without repeating characters. For example, the ...
分类:
其他好文 时间:
2014-12-27 20:14:16
阅读次数:
214
很久之前刷的CTCI的题目,都快忘记了,做个分类汇总,再重新好好复习一遍。
Chapter 1 | Arrays and Strings
1.1 Implement an algorithm to determine if a string has all unique characters. What if you can not use additional
data stru...
分类:
其他好文 时间:
2014-12-26 20:20:00
阅读次数:
452
Longest Substring Without Repeating CharactersGiven a string, find the length of the longest substring without repeating characters. For example, the ...
分类:
其他好文 时间:
2014-12-26 20:14:20
阅读次数:
156
在C语言里面一直很容易混淆的,gets和fgetS的区别:char * fgets ( char * str, int num, FILE * stream );Reads characters fromstreamand stores them as a C string intostruntil...
分类:
编程语言 时间:
2014-12-26 09:34:49
阅读次数:
221
找到最多含有两个不同字符的子串的最长长度。例如:eoeabc,最长的是eoe为3,其他都为2.思路:用p1,p2表示两种字符串的最后一个出现的下标位置。初始p1为0. p2为-1.start初始化为0,表示两种字符串的开头。只要遍历一次string就可以得到结果了。首先我们要确定p2的值,那么i要一...
分类:
其他好文 时间:
2014-12-25 21:47:44
阅读次数:
150
Given a string containing just the characters '(', ')',
'{', '}', '[' and ']', determine if the input string is valid.
The brackets must close in the correct order, "()" and "()[]{}" are all valid b...
分类:
其他好文 时间:
2014-12-25 16:25:57
阅读次数:
123