码迷,mamicode.com
首页 >  
搜索关键字:longest ordered subs    ( 3212个结果
The Longest Straight(二分,离散化)
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
[LeetCode]14.Longest Common Prefix
Write a function to find the longestcommon prefix string amongst an array of strings.中文意思是:找出所有字符串的公共前缀,题目难度为easy。思路:2个字符串的公共前缀,其长度肯定不会超过最短的字符串长度,设最短的...
分类:其他好文   时间:2015-12-27 13:29:03    阅读次数:159
LeetCode: 3_Longest Substring Without Repeating Characters | 求没有重复字符的最长子串的长度 | Medium
题目: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
LeetCode 5 Longest Palindromic Substring(最长子序列)
题目来源: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
[LeetCode]113. Maximum Depth of Binary Tree二叉树的最大深度
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
[?]*Longest Substring with At Most Two Distinct Characters
这也能算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
Longest Common Prefix
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
解题报告:295. Find Median from Data Stream
题目描述: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
poj 2533 Longest Ordered Subsequence 最长递增子序列(LIS)
两种算法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
199. Binary Tree Right Side View (Tree, Stack)
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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!