https://oj.leetcode.com/problems/longest-common-prefix/http://fisherlei.blogspot.com/2012/12/leetcode-longest-common-prefix.htmlpublicclassSolution{
publicStringlongestCommonPrefix(String[]strs)
{
//Validations
if(strs==null||strs.length==0)
return"";
if(s..
分类:
其他好文 时间:
2015-01-02 16:13:25
阅读次数:
103
Given a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.For"(()", the longest...
分类:
其他好文 时间:
2015-01-01 21:10:28
阅读次数:
149
Given two strings, find the longest comment subsequence (LCS).Your code should return the length of LCS.ExampleFor "ABCD" and "EDCA", the LCS is "A" (...
分类:
其他好文 时间:
2015-01-01 00:12:17
阅读次数:
122
Given two strings, find the longest common substring.Return the length of it.NoteThe characters in substring should occur continiously in original str...
分类:
其他好文 时间:
2015-01-01 00:01:16
阅读次数:
339
class Solution {public: int lengthOfLongestSubstring(string s) { char cHash[256]; int cnt = 0, maxCnt = 0; int i, j, k, sSz = ...
分类:
其他好文 时间:
2014-12-31 16:05:02
阅读次数:
143
Longest Consecutive SequenceGiven an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given[100, 4...
分类:
其他好文 时间:
2014-12-30 21:53:34
阅读次数:
189
LeetCode: Palindrome 回文相关题目汇总LeetCode: Palindrome Partitioning 解题报告LeetCode: Palindrome Partitioning II 解题报告Leetcode:【DP】Longest Palindromic Substring...
分类:
其他好文 时间:
2014-12-30 20:37:58
阅读次数:
149
Longest Substring Without Repeating Characters
Total Accepted: 35063 Total
Submissions: 159111My Submissions
Question
Solution
Given a string, find the length of the longest subst...
分类:
其他好文 时间:
2014-12-30 17:16:14
阅读次数:
231
各种被屠...学东西各种慢...QAQ字符串:sam:【SPOJ】7258. Lexicographical Substring Search(后缀自动机)【SPOJ】1812. Longest Common Substring II(后缀自动机)【BZOJ】2555: SubString(后缀自动...
分类:
其他好文 时间:
2014-12-30 15:05:34
阅读次数:
239
The problem: (The code of dynamic programming is very concise and elegant. You must learn it!)Given a stringS, find the longest palindromic substring ...
分类:
其他好文 时间:
2014-12-30 13:16:09
阅读次数:
171