Problem 2216 The Longest StraightAccept: 7Submit: 14 Time Limit: 1000 mSecMemory Limit : 32768 KBProblem DescriptionZB is playing a card game where th...
分类:
其他好文 时间:
2015-12-27 21:44:15
阅读次数:
583
Write a function to find the longestcommon prefix string amongst an array of strings.中文意思是:找出所有字符串的公共前缀,题目难度为easy。思路:2个字符串的公共前缀,其长度肯定不会超过最短的字符串长度,设最短的...
分类:
其他好文 时间:
2015-12-27 13:29:03
阅读次数:
159
题目:Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters...
分类:
其他好文 时间:
2015-12-27 11:58:41
阅读次数:
126
题目来源:https://leetcode.com/problems/longest-palindromic-substring/Given a stringS, find the longest palindromic substring inS. You may assume that the ...
分类:
其他好文 时间:
2015-12-25 21:02:43
阅读次数:
195
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-12-25 20:59:38
阅读次数:
167
这也能算hard题……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 "...
分类:
其他好文 时间:
2015-12-25 06:25:56
阅读次数:
165
1 var longestCommonPrefix = function(strs) { 2 if (strs.length < 1) { 3 return ""; 4 } 5 6 var prefix = strs[0]; 7 8 for (v...
分类:
其他好文 时间:
2015-12-24 20:37:38
阅读次数:
162
题目描述:Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of th...
分类:
其他好文 时间:
2015-12-24 02:03:29
阅读次数:
261
两种算法1. O(n^2) 1 #include 2 #include 3 #include 4 using namespace std; 5 6 int a[1005]; 7 int dp[1005]; 8 int main() 9 {10 int n, maxn;11 whil...
分类:
其他好文 时间:
2015-12-20 13:09:32
阅读次数:
194
Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.For exam...
分类:
其他好文 时间:
2015-12-16 15:23:21
阅读次数:
184