Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa...
分类:
其他好文 时间:
2014-06-28 23:59:00
阅读次数:
383
Write a function to find the longest common prefix string amongst an array of strings.public class Solution { public String longestCommonPrefix(Str...
分类:
其他好文 时间:
2014-06-25 17:03:03
阅读次数:
331
【题目】
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 consecutive elements sequence is [1, 2, 3, 4]. Return its length: 4.
Your algorithm should run...
分类:
其他好文 时间:
2014-06-25 07:55:42
阅读次数:
244
后缀自动机裸题....
Longest Common Substring
Time Limit: 2000MS
Memory Limit: Unknown
64bit IO Format: %lld & %llu
[Submit]
[Go Back] [Status]
Description
A st...
分类:
其他好文 时间:
2014-06-24 22:15:40
阅读次数:
240
题目
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 palindromic substring.
方法
...
分类:
其他好文 时间:
2014-06-24 19:36:55
阅读次数:
212
使用l,r指针游动。
然后使用记录游动过程中的最大值。
我离散化了一下。
#include
#include
#include
#include
#include
#include
using namespace std;
#define maxn 110000
mapmp;
struct list
{
int x;
int get;
int lose;
in...
分类:
其他好文 时间:
2014-06-22 11:52:02
阅读次数:
226
Longest Palindromic Substring:Given a stringS, find the longest palindromic substring inS.You may assume that the maximum length ofSis 1000, and there...
分类:
其他好文 时间:
2014-06-21 07:36:18
阅读次数:
227
题目
Write a function to find the longest common prefix string amongst an array of strings.
方法
从第一个字符开始,判断是否相同。
public String longestCommonPrefix(String[] strs) {
if (strs ...
分类:
其他好文 时间:
2014-06-18 11:18:30
阅读次数:
205
Write a function to find the longest common prefix string amongst an array of strings.题解: 寻找一组字符串的最长公共前缀。最简单的方法,用一个字符串记录当前最长的公共前缀,然后依次比较。时间复杂度: O(N). ...
分类:
其他好文 时间:
2014-06-18 00:03:08
阅读次数:
274
Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa...
分类:
其他好文 时间:
2014-06-17 14:35:50
阅读次数:
297