第一题:longest乌托邦有n个城市,某些城市之间有公路连接。任意两个城市都可以通过公路直接或者间接到达,并且任意两个城市之间有且仅有一条路径(What does this imply? A tree!)。每条公路都有自己的长度,这些长度都是已经测量好的。小修想从一个城市出发开车到另一个城市,并且...
分类:
其他好文 时间:
2015-10-17 18:58:41
阅读次数:
422
题目:最长单词给一个词典,找出其中所有最长的单词。样例在词典{ "dog", "google", "facebook", "internationalization", "blabla"}中, 最长的单词集合为["internationalization"]在词典{ "like", "...
分类:
其他好文 时间:
2015-10-17 17:36:08
阅读次数:
209
题目:最长上升连续子序列给定一个整数数组(下标从 0 到 n-1, n 表示整个数组的规模),请找出该数组中的最长上升连续子序列。(最长上升连续子序列可以定义为从右到左或从左到右的序列。)样例给定[5, 4, 2, 1, 3], 其最长上升连续子序列(LICS)为[5, 4, 2, 1], 返回4....
分类:
其他好文 时间:
2015-10-17 17:34:03
阅读次数:
247
Longest Valid ParenthesesMy SubmissionsQuestionSolutionTotal Accepted:47520Total Submissions:222865Difficulty:HardGiven a string containing just the c...
分类:
其他好文 时间:
2015-10-17 00:41:54
阅读次数:
195
主要学习自:http://articles.leetcode.com/2011/11/longest-palindromic-substring-part-ii.html问题描述:回文字符串就是左右对称的字符串,如:"abba",而最长回文子串则是字符串长度最长的回文子字符串,如"abbaca"的最...
分类:
编程语言 时间:
2015-10-11 17:52:19
阅读次数:
215
[Problem]Write a function to find the longest common prefix string amongst an array of strings.[Analysis]思路非常简单,循环验证每一个字符串就可以通过OJ,代码也没有优化。[Solution]pu...
分类:
其他好文 时间:
2015-10-10 00:11:15
阅读次数:
195
题目:Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters...
分类:
其他好文 时间:
2015-10-08 06:51:29
阅读次数:
214
题目: 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 lo...
分类:
其他好文 时间:
2015-10-06 22:12:48
阅读次数:
479
链接:https://leetcode.com/problems/longest-valid-parentheses/【描述】Given a string containing just the characters'('and')', find the length of the longest ...
分类:
其他好文 时间:
2015-10-05 15:32:54
阅读次数:
196
Given a permutation which contains no repeated number, find its index in all the permutations of these numbers, which are ordered in lexicographical o...
分类:
其他好文 时间:
2015-10-05 14:15:28
阅读次数:
149