码迷,mamicode.com
首页 >  
搜索关键字:longest consecutive    ( 3017个结果
【LeetCode】005. 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. Example: Example: 题解: Solution 1 暴 ...
分类:其他好文   时间:2018-03-24 14:27:06    阅读次数:167
leetcode-3. Longest Substring Without Repeating Characters
1 题目 Given a string, find the length of the longest substring without repeating characters. 给定一个字符串,求该字符串的最长且不含有重复字符的子字符串。 Examples: Given "abcabcbb", ...
分类:其他好文   时间:2018-03-23 11:40:09    阅读次数:160
3. Longest Substring Without Repeating Characters
Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the leng ...
分类:其他好文   时间:2018-03-22 19:14:41    阅读次数:125
LeetCode第[5]题(Java):Longest Palindromic Substring 标签:String、动态规划
题目中文:求最长回文子串 题目难度:Medium 题目内容: Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. 翻译: ...
分类:编程语言   时间:2018-03-19 19:09:23    阅读次数:224
Max Consecutive Ones——leetcode
Given a binary array, find the maximum number of consecutive 1s in this array. Example 1: Note: The input array will only contain 0 and 1. The length ...
分类:其他好文   时间:2018-03-17 21:42:03    阅读次数:207
P1807 最长路_NOI导刊2010提高(07)
题目描述 设G为有n个顶点的有向无环图,G中各顶点的编号为1到n,且当为G中的一条边时有i < j。设w(i,j)为边的长度,请设计算法,计算图G中<1,n>间的最长路径。 输入输出格式 输入格式: 输入文件longest.in的第一行有两个整数n和m,表示有n个顶点和m条边,接下来m行中每行输入3 ...
分类:其他好文   时间:2018-03-14 22:39:11    阅读次数:220
LeetCode 3
Description: Given a string, find the length of the longest substring without repeating characters. 题意: 输入一个字符串, 输出最长不重复子串的长度 思路: 比较一般的思路是, 只要是有关于重复的应 ...
分类:其他好文   时间:2018-03-12 22:54:30    阅读次数:211
79.最长公共子串
def longestCommonSubstring(self, A, B): # write your code here if A == '' or B == '': return 0 if len(A) >= len(B): L, L1 = A[:], B[:] else: L, L... ...
分类:其他好文   时间:2018-03-11 17:41:51    阅读次数:109
[LeetCode] 340. Longest Substring with At Most K Distinct Characters 最多有K个不同字符的最长子串
Given a string, find the length of the longest substring T that contains at most k distinct characters. For example, Given s = “eceba” and k = 2, T is ...
分类:其他好文   时间:2018-03-10 10:19:58    阅读次数:246
LeetCode 3. Longest Substring Without Repeating Characters
问题链接 "LeetCode 3" 题目解析 求字符串的 最长无重复子串 。 解题思路 第一个问题是 子串 ,注意是连续的。 建立一个符号哈希数组 $in[256]$,代表该符号时候出现过,256大小是因为ASCII表共能表示256个字符。初始化为0,代表未出现,当 $in[i] 0$ 时,表示该字 ...
分类:其他好文   时间:2018-03-09 20:37:22    阅读次数:279
3017条   上一页 1 ... 76 77 78 79 80 ... 302 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!