题目: Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the ...
分类:
其他好文 时间:
2017-09-12 12:03:18
阅读次数:
145
最长公共子串(Longest Common Substirng)和最长公共子序列(Longest Common Subsequence,LCS)的区别为:子串是串的一个连续的部分,子序列则是从不改变序列的顺序,而从序列中去掉任意的元素而获得新的序列;也就是说,子串中字符的位置必须是连续的,子序列则可 ...
分类:
其他好文 时间:
2017-09-11 22:57:32
阅读次数:
222
Given an unsorted array of integers, find the length of longest continuous increasing subsequence.Example 1:Input: [1,3,5,4,7] Output: 3 Explanation: ... ...
分类:
其他好文 时间:
2017-09-10 18:45:50
阅读次数:
382
Note: 1. If it does not belong any sequences : append.getOrDefault(num, 0) == 0, create a new sequence. It requires num + 1 and num + 2 count > 0. 2. ...
分类:
其他好文 时间:
2017-09-10 15:48:54
阅读次数:
144
Given an unsorted array of integers, find the length of longest continuous increasing subsequence. Example 1: Example 2: Note: Length of the array wil ...
分类:
其他好文 时间:
2017-09-10 12:35:02
阅读次数:
137
But failed with time exceed. The one with better solution is shown as below: Much simpler. Ich denke, dass muss ich härter arbeiten. Nächste Station, ...
分类:
其他好文 时间:
2017-09-09 17:19:30
阅读次数:
163
这道题为简单题 题目: 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 ...
分类:
其他好文 时间:
2017-09-06 23:57:45
阅读次数:
421
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-05 13:29:23
阅读次数:
171
这个题用DP,千万不能将state设为f[i]表示前i个数字中最长的LIS的长度 ,而是设成f[i]表示前i个数字中以第i个结尾的LIS的长度。如果那样定义,f[i]和f[j]之间是没有太大关系。 比如7,8,10,2,3,4,5可以,但2,3,9,10,5,6,7,8就不行 ...
分类:
其他好文 时间:
2017-09-04 21:29:01
阅读次数:
173
本题虽然是easy难度,题目也一目了然,问题就是在这里,需要考虑的特殊情况太多,太多限制。导致我一点点排坑,浪费了较多时间。 Write a function to find the longest common prefix string amongst an array of strings. ...
分类:
其他好文 时间:
2017-09-04 01:03:34
阅读次数:
167