H -LISTime Limit:2000MSMemory Limit:65536KB64bit IO Format:%I64d & %I64uSubmitStatusDescriptionA numeric sequence ofaiis ordered ifa1<a2< ... <aN. Let...
分类:
其他好文 时间:
2014-10-28 23:49:45
阅读次数:
261
1, 思考过程比较慢,加强锻炼2,空字符串的定义,不能用null3,数组的长度为array.length,而string的长度为函数 string.length()public class Solution { public String longestCommonPrefix(String[...
分类:
其他好文 时间:
2014-10-27 12:37:47
阅读次数:
246
DP、KMP什么的都太高大上了,自己想了个朴素的遍历方法。
【题目】
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 longest palin...
分类:
其他好文 时间:
2014-10-26 15:37:32
阅读次数:
249
【题意】
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without
repeating letters for "abcabcbb" is "abc", which the length is...
分类:
其他好文 时间:
2014-10-26 11:49:53
阅读次数:
203
Given a string containing just the characters '(' and ')',
find the length of the longest valid (well-formed) parentheses substring.
For "(()", the longest valid parentheses substring is "()",
...
分类:
其他好文 时间:
2014-10-26 11:49:43
阅读次数:
185
Longest Consecutive SequenceGiven an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given [100, ...
分类:
其他好文 时间:
2014-10-26 11:40:45
阅读次数:
111
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 le...
分类:
其他好文 时间:
2014-10-26 07:58:51
阅读次数:
161
题目
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....
分类:
其他好文 时间:
2014-10-25 18:50:01
阅读次数:
137
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without
repeating letters for "abcabcbb" is "abc", which the length is 3. Fo...
分类:
其他好文 时间:
2014-10-25 07:04:13
阅读次数:
208
Write a function to find the longest common prefix string amongst an array of strings.题目言简意赅,貌似也不难,暴力法用一个char *数组存放strs里每个元素的起始地址,然后循环,同时把所有指针向前移动,如果有...
分类:
其他好文 时间:
2014-10-25 00:52:44
阅读次数:
265