题目链接 Problem Description The signature of a permutation is a string that is computed as follows: for each pair of consecutive elements of the permutat ...
分类:
其他好文 时间:
2017-10-08 21:28:49
阅读次数:
203
Note: 1. Find a increasing digits number. It's kind of longest increasing subsequence but with fixed size. 2. Remember to remove the zeros from beginn ...
分类:
其他好文 时间:
2017-10-08 16:50:40
阅读次数:
168
Given a binary tree, find the length of the longest path where each node in the path has the same value. This path may or may not pass through the roo ...
分类:
其他好文 时间:
2017-10-08 00:55:06
阅读次数:
125
Given a binary tree, find the length of the longest path where each node in the path has the same value. This path may or may not pass through the roo ...
分类:
其他好文 时间:
2017-10-07 23:30:53
阅读次数:
221
5. 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 ...
分类:
其他好文 时间:
2017-10-07 18:37:52
阅读次数:
127
In the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecutive metallic ...
分类:
其他好文 时间:
2017-10-07 14:48:49
阅读次数:
199
Given a 01 matrix M, find the longest line of consecutive one in the matrix. The line could be horizontal, vertical, diagonal or anti-diagonal. Exampl ...
分类:
其他好文 时间:
2017-10-07 12:19:16
阅读次数:
291
Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the leng ...
分类:
其他好文 时间:
2017-10-06 10:36:15
阅读次数:
140
题目: Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. For "(()", th ...
分类:
其他好文 时间:
2017-10-05 22:38:05
阅读次数:
262
class Solution { public int longestConsecutive(int[] nums) { Set set=new HashSet(); for(int num:nums) set.add(num); int res=0; for(int num:set) ... ...
分类:
其他好文 时间:
2017-10-04 12:31:53
阅读次数:
139