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-09-13 20:08:35
阅读次数:
179
HashMap 在leetcode Longest Consecutive Sequence 上巧妙使用。...
分类:
其他好文 时间:
2014-09-13 15:57:45
阅读次数:
144
[leetcode]Longest Common Prefix...
分类:
其他好文 时间:
2014-09-13 10:39:35
阅读次数:
173
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given[100, 4, 200, 1, 3, 2],The longest ...
分类:
其他好文 时间:
2014-09-11 20:41:12
阅读次数:
111
class Solution {private: const char sep_char = '\1';public: string longestPalindrome(string s) { int max_len = 0; int len = s....
分类:
其他好文 时间:
2014-09-11 01:06:51
阅读次数:
265
问题描述:序列X={x1,x2,…,xn},Y={y1,y2,…,yn},当Z={z1,z2…,zn}是X的严格递增下标顺序(可以不连续)的子集,也是Y的严格递增下标顺序(可以不连续)的子集,则Z是X和Y的公共子序列。例如X={A,B,C,B,D,A,B},Y={B,D,C,A,B,A},{B,C,A}、{B,C,B,A}、{B,D,A,B}都是X和Y的公共子序列。其中最长的公共子序列叫做Long...
分类:
其他好文 时间:
2014-09-10 15:53:20
阅读次数:
317
It's still an Amazon interview question. Given an array containing only stars '*' and hashes '#' . Find longest contiguous sub array that will cont...
分类:
其他好文 时间:
2014-09-09 21:20:49
阅读次数:
254
Longest Valid Parentheses
Total Accepted: 14818 Total
Submissions: 75749My Submissions
Given a string containing just the characters '(' and ')',
find the length of the longest valid (w...
分类:
其他好文 时间:
2014-09-09 13:18:18
阅读次数:
166
Longest Common Prefix
Total Accepted: 17298 Total
Submissions: 63704My Submissions
Write a function to find the longest common prefix string amongst an array of strings.
题意...
分类:
其他好文 时间:
2014-09-09 13:16:38
阅读次数:
135
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-09-09 12:14:08
阅读次数:
200