1 题目:Write a function to find the longest common prefix string amongst an array of strings.Hide TagsString2 思路所有字符串公共的前缀,那么第一个字符串肯定包括了。 从第一个字符串开始遍历着手即...
分类:
其他好文 时间:
2015-06-14 16:26:59
阅读次数:
102
The Longest Common Subsequence (LCS) problem is as follows:Given two sequences s andt, find the length of the longest sequence r, which is a subsequen...
分类:
其他好文 时间:
2015-06-14 00:30:15
阅读次数:
177
The Longest Common Substring (LCS) problem is as follows:Given two strings s and t, find the length of the longest string r, which is a substring of b...
分类:
其他好文 时间:
2015-06-13 23:04:33
阅读次数:
120
This problem is a nice extension of the Valid Parentheses problem.There are several ways to solve it. The first idea is also to use a stack. However, ...
分类:
其他好文 时间:
2015-06-13 16:56:41
阅读次数:
130
题目链接 题目要求: Given a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring. For...
分类:
其他好文 时间:
2015-06-12 23:52:34
阅读次数:
120
1. Question求最长回文子串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...
分类:
其他好文 时间:
2015-06-12 23:49:08
阅读次数:
228
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 le...
分类:
其他好文 时间:
2015-06-12 23:40:02
阅读次数:
121
Problem Description:Given a string, find the length of the longest substring T that contains at most 2 distinct characters.For example, Given s =“eceb...
分类:
其他好文 时间:
2015-06-12 22:04:43
阅读次数:
103
This problem is not very intuitive at first glance. However, the final idea should be very self-explanatory. You visit each element in nums, and then ...
分类:
其他好文 时间:
2015-06-12 19:10:09
阅读次数:
103
1. Question求最长无重复字符子串。Given a string, find the length of the longest substring without repeating characters. For example, the longest substring withou...
分类:
其他好文 时间:
2015-06-12 16:48:13
阅读次数:
118