求最长字串,要求字串中的所有字母不重复 思路 设定head和tail两个指针,tail每往前移动一格,便检查tail和head之间的所有字母是否与tail指向的字母重复,如果重复则将head指向重复的后一格例如:abcdefdc,当前head指向a,tail指向f,当tail指向下一个d的时候扫描h...
分类:
其他好文 时间:
2015-03-30 12:54:25
阅读次数:
114
1 package leetcode; 2 3 import java.util.ArrayList; 4 import java.util.List; 5 6 class TrieNode{ 7 Boolean isWord;//true if path till ...
分类:
其他好文 时间:
2015-03-30 08:03:13
阅读次数:
252
题目:leetcode
Longest Substring Without Repeating Characters
Given
a string, find the length of the longest substring without repeating characters. For example, the longest substring without repea...
分类:
编程语言 时间:
2015-03-29 18:08:07
阅读次数:
152
1.题目要求Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating lett...
分类:
其他好文 时间:
2015-03-29 17:51:03
阅读次数:
123
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 ha...
分类:
其他好文 时间:
2015-03-29 13:41:53
阅读次数:
124
题意:给你一个序列,问你删除掉连续的一段,使得剩下的序列的最长上升字串最大,问你这个最大值。解题思路:分段dp, dp[i][0] ,dp[i][1] , 0表示前面没有切过,只能从前一个数的0状态得到,1状态表示前面已经切过了,能从前一个的1状态得到,也能从 在他前面的比他值小的dp[j][0]....
分类:
其他好文 时间:
2015-03-29 09:24:58
阅读次数:
128
1551: Longest Increasing Subsequence Again
Time Limit: 2 Sec Memory Limit: 256 MB
Submit: 29 Solved: 15
[Submit][Status][Web
Board]
Description
Give you a numeric sequence. If you can d...
分类:
其他好文 时间:
2015-03-28 23:18:21
阅读次数:
432
Emuskald is an avid horticulturist and owns the world’s longest greenhouse — it is effectively infinite in length.Over the years Emuskald has cultivated n plants in his greenhouse, of m different plant...
分类:
其他好文 时间:
2015-03-28 14:24:52
阅读次数:
135
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without
repeating letters for "abcabcbb" is "abc", which the length is 3. Fo...
分类:
其他好文 时间:
2015-03-22 10:40:52
阅读次数:
321
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...
分类:
其他好文 时间:
2015-03-22 00:18:36
阅读次数:
134