Given an integer matrix, find the length of the longest increasing path. From each cell, you can either move to four directions: left, right, up or do ...
分类:
其他好文 时间:
2016-04-29 14:21:49
阅读次数:
194
题目 Given an integer matrix, find the length of the longest increasing path. From each cell, you can either move to four directions: left, right, up or... ...
分类:
其他好文 时间:
2016-04-28 19:54:32
阅读次数:
143
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 farthest l ...
分类:
其他好文 时间:
2016-04-25 20:55:00
阅读次数:
129
Maximum Depth of Binary Tree Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the roo ...
分类:
其他好文 时间:
2016-04-25 00:37:34
阅读次数:
142
例子: 3,8,4,5,6,2 返回值应该为 :5 这是昨天做的一道优酷土豆的编程题,和leetcode中的128/ Longest Consecutive Sequence 有点相似,但是leetcode题的公差是确定的1,而这道题的公差是不确定的。 本人的写出的是一种通过穷举的方法实现查找最长等 ...
分类:
其他好文 时间:
2016-04-24 20:07:44
阅读次数:
722
Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the leng ...
分类:
其他好文 时间:
2016-04-23 11:33:14
阅读次数:
209
描述 多次询问,对于一个给定的n,求有多少组连续的素数,满足连续素数之和为n. 分析 尺取法. 打个素数表,对于每一个n,尺取之. 换了种尺取法的写法= =. 1 #include<cstdio> 2 3 const int maxn=10005; 4 int p,n; 5 int prime[ma ...
分类:
其他好文 时间:
2016-04-23 10:27:57
阅读次数:
187
Longest Palindromic Substring 最长回文子串 Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 100 ...
分类:
其他好文 时间:
2016-04-22 18:25:01
阅读次数:
147
Given a string, find the length of the longest substring T that contains at most 2 distinct characters. For example, Given s = “eceba”, T is "ece" whi ...
分类:
其他好文 时间:
2016-04-22 13:24:06
阅读次数:
159