given a string ,return the longest substring that contains at most twocharacters.extern "C" char *SubStringWithAtMost2Chars(char * pStr, int len){ ...
分类:
其他好文 时间:
2014-09-03 14:29:36
阅读次数:
211
matches -> 始终与最长的进行匹配match -> 始终与第一个进行匹配longest_common_prefix -> 共同的前缀的长度longest_common_suffix -> 共同的后缀的长度binary:part(>, {3,4}) == binary:part(>, {7.....
分类:
其他好文 时间:
2014-09-03 12:49:16
阅读次数:
173
Given a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.For"(()", the longest...
分类:
其他好文 时间:
2014-09-03 10:59:16
阅读次数:
183
poj 2533 & poj 1631 Longest Ordered Subsequence( LIS果题 )...
分类:
其他好文 时间:
2014-09-02 09:05:44
阅读次数:
232
问题描述
Given a binary tree, find its maximum depth.
The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
解决方案
/**
* Definition fo...
分类:
其他好文 时间:
2014-09-02 00:26:44
阅读次数:
217
Surprising Strings
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 5940
Accepted: 3894
Description
The D-pairs of a string of letters are the ordered pairs...
分类:
其他好文 时间:
2014-09-01 12:34:43
阅读次数:
234
题目:
Write a function to find the longest common prefix string amongst an array of strings.
解析:求字符串数组中所有数组的最长公共前缀,重点考察细节和边界条件,比如:
[] :输入字符串数组为空,要判断if (strs .size() == 0) ...
分类:
其他好文 时间:
2014-08-28 17:02:31
阅读次数:
253
LeetCode: Maximum Depth of Binary TreeGiven a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from...
分类:
其他好文 时间:
2014-08-27 21:54:58
阅读次数:
234
两种方法:1. 利用 hash_map 结构,数组有序时查找的思想。
2. 动态的构造有向线段(矢量)(两端为线段始末位置)。若当前点可增加有向线段长度,拓展线段。
分类:
其他好文 时间:
2014-08-27 01:32:36
阅读次数:
162
Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longes...
分类:
其他好文 时间:
2014-08-26 19:09:06
阅读次数:
153