Given a sequence of N pairs of integers, find the length of the longest increasing subsequence of it. An increasing sequence A1..An is a sequence such ...
分类:
其他好文 时间:
2018-05-29 00:11:01
阅读次数:
119
A string is finite sequence of characters over a non empty finite set Σ. In this problem, Σ is the set of lowercase letters. Substring, also called fa ...
分类:
其他好文 时间:
2018-05-28 17:24:28
阅读次数:
161
题目: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. E ...
分类:
其他好文 时间:
2018-05-27 15:39:22
阅读次数:
183
vector处理字符串,老司机,你值得拥有 ...
分类:
其他好文 时间:
2018-05-27 12:05:23
阅读次数:
127
题目:Longest Substring Without Repeating Characters Given a string, find the length of the longest substring without repeating characters. Examples: Giv ...
分类:
其他好文 时间:
2018-05-26 23:26:09
阅读次数:
206
Description Some positive integers can be represented by a sum of one or more consecutive prime numbers. How many such representations does a given po ...
分类:
其他好文 时间:
2018-05-26 12:57:12
阅读次数:
152
问题描述: Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example 1: Example 2: 思路: 根据 ...
分类:
其他好文 时间:
2018-05-26 10:44:49
阅读次数:
162
Given an unsorted array of integers, find the length of the longest consecutive elements sequence. Your algorithm should run in O(n) complexity. Examp ...
分类:
其他好文 时间:
2018-05-23 13:07:29
阅读次数:
303
Recursion: 时间O(n) 空间O(h) 因为要找最长的连续路径,我们在遍历树的时候需要两个信息,一是目前连起来的路径有多长,二是目前路径的上一个节点的值。我们通过递归把这些信息代入,然后通过返回值返回一个最大的就行了。 ...
分类:
其他好文 时间:
2018-05-23 11:57:56
阅读次数:
163
In a string S of lowercase letters, these letters form consecutive groups of the same character. For example, a string like S = "abbxxxxzyy" has the g ...
分类:
其他好文 时间:
2018-05-21 10:36:58
阅读次数:
179