码迷,mamicode.com
首页 >  
搜索关键字:longest consecutive    ( 3017个结果)
Longest Palindromic Substring
题目 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 lon ...
分类:其他好文   时间:2016-04-11 18:11:35    阅读次数:155
LeetCode之14---Longest Common Prefix
题目:   Write a function to find the longest common prefix string amongst an array of strings. 题目大意:     写一个函数,求一个字符串数组中最长的公共前缀子串。 思路:   在做这道题之前先要了解一下什么叫做公共前缀子串。在英语中一个单词可以分为前缀、词根、后缀三部分,所谓前缀就是指在单词的开...
分类:其他好文   时间:2016-04-11 12:32:43    阅读次数:128
(DP)3.Longest Substring Without Repeating Characters
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo ...
分类:其他好文   时间:2016-04-11 07:10:54    阅读次数:133
【leetcode】3. Longest Substring Without Repeating Characters
计算最长的无重复字符的串长 用HashMap记住重复的单词及其位置。当重复时,让tempStart指针移到重复位置+1,如果start指针小于tempStart,则更新start指针,长度就是当前重复的位置 - start。读到字符串末尾时还需要判断一次 ...
分类:其他好文   时间:2016-04-10 12:54:35    阅读次数:112
Longest Valid Parentheses
因为要算匹配长度,所以要记录起始的位置。思路上要分三种情况吧,一种是完全匹配,一种是未匹配的是‘)’,一种是未匹配的是‘(’。如果发现没有左括号可以和右括号匹配,那么只要把右括号位置设置为start,重新开始新一轮的寻找就可以了;如果没有右括号可以和左括号匹配,则要用当前位置减去堆栈栈顶的左括号位置 ...
分类:其他好文   时间:2016-04-10 12:42:46    阅读次数:216
5.Longest Palindrome substring
...
分类:其他好文   时间:2016-04-10 10:17:42    阅读次数:114
3. Longest Substring Without Repeating Characters
...
分类:其他好文   时间:2016-04-10 09:08:36    阅读次数:138
【leetcode】32. Longest Valid Parentheses
这题不能使用递归来写,因为有一个输入长度是17173,会爆栈。因此得手动模拟栈调用。 ...
分类:其他好文   时间:2016-04-10 01:01:45    阅读次数:110
LeetCode_104_Maximum Depth of Binary Tree
104. 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 th ...
分类:其他好文   时间:2016-04-09 12:19:07    阅读次数:160
LeetCode_3_Longest Substring Without Repeating Characters
3. Longest Substring Without Repeating Characters Given a string, find the length of the longest substring without repeating characters. For example, ...
分类:其他好文   时间:2016-04-09 12:15:03    阅读次数:110
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!