Longest Common PrefixTotal Accepted:44093Total Submissions:169565My SubmissionsQuestionSolutionWrite a function to find the longest common prefix stri...
分类:
其他好文 时间:
2015-04-26 12:09:13
阅读次数:
103
原题:Given a string, find the length of the longest substring without repeating characterFor example, the Longest substring without repeating letters fo...
分类:
编程语言 时间:
2015-04-25 22:41:48
阅读次数:
229
Write a function to find the longest common prefix string amongst an array of strings.这题是寻找一组字符串的最长公共前缀,举个例子:“abc” "a"显然lPrefixString = "a",注意检查空串的情况!...
分类:
其他好文 时间:
2015-04-25 19:48:20
阅读次数:
114
问题描述: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 l...
分类:
编程语言 时间:
2015-04-25 14:54:13
阅读次数:
145
问题描述:Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating lette...
分类:
编程语言 时间:
2015-04-25 14:50:46
阅读次数:
131
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...
分类:
编程语言 时间:
2015-04-25 12:09:43
阅读次数:
158
Given a string S, find the length of the longest substring T that contains at most two distinct characters.Given S = “eceba”,T is “ece” which its leng...
分类:
其他好文 时间:
2015-04-24 07:48:35
阅读次数:
109
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo...
分类:
编程语言 时间:
2015-04-23 23:22:16
阅读次数:
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 “()”, which h...
分类:
其他好文 时间:
2015-04-23 21:49:15
阅读次数:
156
题目:Write a function to find the longest common prefix string amongst an array of strings.
翻译:求一个字符串数组中 共同的最长前缀。
思路:以第一个串为基准,逐个位置遍历,并遍历字符串数组,如果出现某个字符串长度小于当前位置,或者出现当前位置的字符不相同,返回字串strs[0].substring(0,p...
分类:
其他好文 时间:
2015-04-23 11:05:31
阅读次数:
108