题目的大意是,给定一个整数矩阵,计算其要求元素排列是递增的,球最长递增路径的长度。从任意一个矩阵位置出发,可向上下左右四个方向移动。不可以沿着对角线移动,也不能离开边界。(环绕也是不允许的)。题目还给出了两个测试用例。...
分类:
其他好文 时间:
2016-02-22 00:28:06
阅读次数:
177
原题链接在这里:https://leetcode.com/problems/longest-increasing-path-in-a-matrix/ Given an integer matrix, find the length of the longest increasing path. Fr
分类:
其他好文 时间:
2016-02-20 08:07:17
阅读次数:
204
Longest Common Substring II Time Limit: 236MS Memory Limit: 1572864KB 64bit IO Format: %lld & %llu Description A string is finite sequence of characte
分类:
其他好文 时间:
2016-02-18 16:22:33
阅读次数:
310
Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longes
分类:
其他好文 时间:
2016-02-15 22:38:44
阅读次数:
197
题目: Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letter
分类:
其他好文 时间:
2016-02-10 22:13:17
阅读次数:
205
刚做了两道Two Sigma OA。 还是两道老题, Friend Cycle和Longest Chain。 Friend Cycle可以用Union Find来做。优化的时候因为矩阵是沿对角线对称,所以可以只扫描一半的元素,也可以加上Path Compresssion和 weight。 Longe
分类:
其他好文 时间:
2016-02-08 13:32:51
阅读次数:
382
Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. For "(()", the lo
分类:
其他好文 时间:
2016-02-06 22:22:13
阅读次数:
174
题目Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters
分类:
其他好文 时间:
2016-02-06 14:11:21
阅读次数:
131
原题链接在这里:https://leetcode.com/problems/longest-substring-with-at-most-two-distinct-characters/ 与Longest Substring Without Repeating Characters类似。 维护一个窗
分类:
其他好文 时间:
2016-02-05 11:29:14
阅读次数:
179
Problem 2216 The Longest StraightAccept: 82 Submit: 203Time Limit: 1000 mSec Memory Limit : 32768 KB Problem DescriptionZB is playing a card game wher
分类:
其他好文 时间:
2016-02-04 13:24:32
阅读次数:
217