Minimum Window SubstringGiven a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).Fo...
One classic method for composing secret messages is called a square code. The spaces are removed from the english textand the characters are written i...
分类:
其他好文 时间:
2014-08-14 20:03:09
阅读次数:
276
Implement wildcard pattern matching with support for '?' and '*'.'?' Matches any single character.'*' Matches any sequence of characters (including th...
分类:
其他好文 时间:
2014-08-14 19:44:09
阅读次数:
134
不要因为走的太远而忘记我们为什么出发[问题描述]Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets mu...
分类:
其他好文 时间:
2014-08-14 01:00:57
阅读次数:
160
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Pana...
分类:
其他好文 时间:
2014-08-14 00:59:37
阅读次数:
195
Description
D
Anti-Rhyme Pairs
Input: Standard Input
Output: Standard Output
Often two words that rhyme also end in the same sequence of characters. We use...
分类:
其他好文 时间:
2014-08-13 18:45:37
阅读次数:
230
iSO 8859-1 characters char glyph HTML tag ? ? ¡ ¢ ¢ £ £ ¤ ¤ ¥ ¥ | ¦ § § ¨ ¨ ? © a ª ? « ? ¬ ? ? ® ˉ ...
分类:
Web程序 时间:
2014-08-11 18:20:22
阅读次数:
340
\(O(nlogn)\)可能会超时,最优二叉树有\(O(n)\)的做法,当年合并果子全机房就我最快,哈哈。。开两个队列,一个存放未合并的节点,一个存放合并之后的子树,每次取最小时只需考虑这两个队列中的最小值即可,可以证明在队列内的元素单调。notice: 输入数据已经排好序了,Characters ...
分类:
其他好文 时间:
2014-08-11 08:22:41
阅读次数:
459
Description
Given a string of 0's and
1's up to
1000000 characters long and indices
i and
j, you are to answer a question whether all characters between position
min(i,j) and position
max(i,j...
分类:
其他好文 时间:
2014-08-10 18:47:30
阅读次数:
277
Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must close in the correct ...
分类:
其他好文 时间:
2014-08-10 15:23:20
阅读次数:
215