Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. For "(()", the lo ...
分类:
其他好文 时间:
2017-06-18 18:08:00
阅读次数:
127
题目:Longest Increasing Path in a Matrix Given an integer matrix, find the length of the longest increasing path. From each cell, you can either move to ...
分类:
其他好文 时间:
2017-06-17 22:33:29
阅读次数:
163
class Solution { public: int lengthOfLongestSubstring(string s) { int hashTable[255]; fill(hashTable, hashTable+255, -1); int start = 0, maxLen = 0; f... ...
分类:
其他好文 时间:
2017-06-17 19:36:29
阅读次数:
106
题意 在年度阅兵中,所有的士兵蛇都在阅兵场集合了,但这些蛇的站位不对。整场阅兵必须能从主席台看清楚,所有蛇都应该站成一排。但这些士兵非常懒惰,你必须指挥士兵重新排队,使得所有人的移动距离之和最短。 形式化地,整支阅兵队伍可以视作一条数轴。共有N条蛇,每条蛇是一根长度为L的线段。第i条蛇初始时占据了[ ...
分类:
其他好文 时间:
2017-06-17 18:20:13
阅读次数:
194
//**************************************************************************************************** // // 求一个数组的最长递减子序列 - C++ - by Chimomo // // 题目 ...
分类:
编程语言 时间:
2017-06-17 13:08:27
阅读次数:
170
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example: Example: ...
分类:
其他好文 时间:
2017-06-17 12:11:51
阅读次数:
128
Suppose we abstract our file system by a string in the following manner: The string "dir\n\tsubdir1\n\tsubdir2\n\t\tfile.ext" represents: The director ...
分类:
其他好文 时间:
2017-06-17 10:03:46
阅读次数:
206
题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=13&page=show_problem&problem=1041 LCS类型的题,不过并不是找common character,而 ...
分类:
其他好文 时间:
2017-06-13 22:41:36
阅读次数:
192
485. Max Consecutive Ones 题目: Given a binary array, find the maximum number of consecutive 1s in this array. Example 1: Note: The input array will onl ...
分类:
编程语言 时间:
2017-06-13 20:44:17
阅读次数:
289
题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=4&page=show_problem&problem=167 这道题实际上就是在一个序列中找出最长的非降sub序列。第一个序列就是 ...
分类:
其他好文 时间:
2017-06-12 20:38:43
阅读次数:
188