Brutal Force: O(n^2) Manacher: O(n) ...
分类:
其他好文 时间:
2017-09-21 15:53:52
阅读次数:
109
JAVA: 3. Longest Substring Without Repeating Characters 以前一直想找到一种数组,不用事先规定大小,可以直接插入,现在发现了,可以用hashset,但是无法知道位置信息 可以用这个 int[26] for Letters 'a' - 'z' or ...
分类:
其他好文 时间:
2017-09-19 11:16:38
阅读次数:
147
Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the leng... ...
分类:
其他好文 时间:
2017-09-19 11:07:00
阅读次数:
131
Given an unsorted array of integers, find the length of longest continuous increasing subsequence. Example 1: Example 2: 在未排序的数组中,找出最长递增序列的长度 c++(16ms ...
分类:
其他好文 时间:
2017-09-16 17:20:37
阅读次数:
141
原题链接在这里:https://leetcode.com/problems/number-of-longest-increasing-subsequence/description/ 题目: Given an unsorted array of integers, find the number o ...
分类:
其他好文 时间:
2017-09-16 13:34:11
阅读次数:
134
You are given an integer array sorted in ascending order (may contain duplicates), you need to split them into several subsequences, where each subseq ...
分类:
编程语言 时间:
2017-09-15 13:33:12
阅读次数:
708
The diameter of a tree (sometimes called the width) is the number of nodes on the longest path between two leaves in the tree. The diagram below shows ...
分类:
其他好文 时间:
2017-09-15 10:09:43
阅读次数:
147
地址:http://www.spoj.com/problems/LCS2/ 题面: LCS2 - Longest Common Substring II no tags no tags A string is finite sequence of characters over a non-empt ...
分类:
其他好文 时间:
2017-09-14 10:34:44
阅读次数:
158
这道题为简单题 题目: 思路: 设置三个变量,max_long 存储总的最大长度,l代表该值目前的最大长度,num主要用来比较列表的前后大小。如果i大于num那么l就一直加1.否则l就和max_long比较大小,l变为1,num更新为i值 代码: ...
分类:
其他好文 时间:
2017-09-14 00:32:17
阅读次数:
148
题目大意: 求两个字符串的LCS。 思路: 对其中一个字符串构建SAM,然后用另一个字符串在里面匹配,按照SAM的边一直往下走,匹配到的连续的字符数就是公共字串的长度。 ...
分类:
其他好文 时间:
2017-09-12 15:55:43
阅读次数:
150