题目:
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.
题意:
给定字符串S...
分类:
编程语言 时间:
2015-07-06 12:30:14
阅读次数:
115
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 leaf node.Hide Tags: Tree ,Depth-first Search/**
* D...
分类:
其他好文 时间:
2015-07-06 12:29:01
阅读次数:
112
Q:Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters ...
分类:
其他好文 时间:
2015-07-05 16:41:08
阅读次数:
97
public class Solution { public String longestPalindrome(String s) { //本题是动态规划思想,构造一个数组pal[i][j],表示从i到j是否为一个回文, //pal[i][j]=true;if i=...
分类:
其他好文 时间:
2015-07-04 22:14:37
阅读次数:
236
题目: 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 lo...
分类:
其他好文 时间:
2015-07-04 18:11:21
阅读次数:
119
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo...
分类:
其他好文 时间:
2015-07-04 15:14:10
阅读次数:
107
原题链接:https://leetcode.com/problems/longest-palindromic-substring/
题目:Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exis...
分类:
其他好文 时间:
2015-07-03 10:45:37
阅读次数:
146
128. Longest Consecutive Sequence1. 问题描述:输入一个未排序的整型数组,找到最长的连续元素序列,并返回其长度。2. 解决思路:拿到这道题,首先想到是先排序,然后遍历找到连续最长的元素。但是我们想通过更好的方式去解决这个问题。所以想到用HashMap存储每个节点的值和这个节点所在序列的长度。当遍历到每个元素时,找当前Map中是否有这个元素的左右连续元素存在,然后计算...
分类:
其他好文 时间:
2015-07-03 09:16:54
阅读次数:
103
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 "()",
...
分类:
其他好文 时间:
2015-07-03 00:20:43
阅读次数:
143
Longest Common PrefixWrite a function to find the longest common prefix string amongst an array of strings.题目的意图It seems that it is not to check betwe...
分类:
其他好文 时间:
2015-07-01 17:35:29
阅读次数:
132