32. Longest Valid Parentheses Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parenthese ...
分类:
其他好文 时间:
2016-08-17 06:47:22
阅读次数:
143
原题如下: 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 ...
分类:
其他好文 时间:
2016-08-15 18:59:55
阅读次数:
146
[题目] 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 farth ...
分类:
其他好文 时间:
2016-08-14 14:22:35
阅读次数:
92
原文 http://xuanwo.org/2015/07/31/dp-lis/ 主题 动态规划 原文 http://xuanwo.org/2015/07/31/dp-lis/ 主题 动态规划 介绍 最长上升子序列问题,也就是 Longest increasing subsequence ,缩写为LI ...
分类:
其他好文 时间:
2016-08-14 07:24:45
阅读次数:
135
Aug.13th consecutive 英 [k?n?sekj?t?v] 美 [k?n?s?kj?t?v] adj.连续的,连贯的;[语]表示结果的 precisely 英 [pr??sa?sli] 美 [pr??sa?sli] adv.精确地;恰好地;严谨地,严格地;一丝不苟地 ...
分类:
其他好文 时间:
2016-08-13 22:36:01
阅读次数:
163
https://leetcode.com/problems/longest-palindromic-substring/ 题目:求字符串最长回文串。 第一种思路:以每一个字符为回文串中间的字符时,最长的回文串。考虑回文串字符个数为奇数,偶数的2种情况。 x--,j++ 的向两边扩展,判断最长的回文串 ...
分类:
其他好文 时间:
2016-08-13 21:08:35
阅读次数:
113
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 l ...
分类:
其他好文 时间:
2016-08-13 19:34:06
阅读次数:
98
Given a sequence of integers, find the longest increasing subsequence (LIS). You code should return the length of the LIS. Clarification What's the de ...
分类:
其他好文 时间:
2016-08-13 06:35:11
阅读次数:
361
Description Peter has a sequence and he define a function on the sequence -- , where is the length of the longest increasing subsequence ending with . ...
分类:
其他好文 时间:
2016-08-12 19:44:17
阅读次数:
213
14.LongestCommonPrefixWriteafunctiontofindthelongestcommonprefixstringamongstanarrayofstrings.题目大意:求一组字符串的最长前缀。代码如下:classSolution{
public:
stringlongestCommonPrefix(vector<string>&strs){
if(strs.size()==0)
return"";
intminStr..
分类:
其他好文 时间:
2016-08-10 23:03:56
阅读次数:
186