码迷,mamicode.com
首页 >  
搜索关键字:longest substring    ( 5540个结果
OJ练习7——T14 Longest Common Prefix
得到一个string序列的最长公共前缀。【思路】先求得最小string的长度,使得比较次数尽可能少。对于要返回的prefix的每一位,从第一个string中取一个字符,拿来和其他string同样位置的字符比较;如果不相同,则返回当前的prefix,否则添加到prefix后。【注意】读取第i个stri...
分类:其他好文   时间:2015-04-08 10:50:46    阅读次数:81
一天三题LeetCode(C++&JAVA)-1~3
1.Two Num 2.Add Two Numbers 3.Longest Substring Without Repeating Characters...
分类:编程语言   时间:2015-04-08 09:14:09    阅读次数:200
Longest Palindromic Substring——LeetCode
Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa...
分类:其他好文   时间:2015-04-08 00:54:17    阅读次数:113
LeetCode Longest Substring Without Repeating Characters 最长不重复子串
题意:给一字符串,求一个子串的长度,该子串满足所有字符都不重复。字符可能包含标点之类的,不仅仅是字母。按ASCII码算,就有2^8=128个。思路:从左到右扫每个字符,判断该字符距离上一次出现的距离是多少,若大于max,则更新max。若小于,则不更新。每扫到一个字符就需要更新他的出现位置了。这里边还...
分类:其他好文   时间:2015-04-07 23:16:50    阅读次数:153
POJ1226---Substrings(后缀数组+二分)
Description You are given a number of case-sensitive strings of alphabetic characters, find the largest string X, such that either X, or its inverse can be found as a substring of any of the given str...
分类:编程语言   时间:2015-04-07 21:52:51    阅读次数:169
#5 Longest Palindromic Substring
Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa...
分类:其他好文   时间:2015-04-07 21:31:44    阅读次数:120
Palindrome Partitioning II
Given a strings, partitionssuch that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioning ofs...
分类:其他好文   时间:2015-04-07 17:01:07    阅读次数:160
【LeetCode】Longest Valid Parentheses 解题报告
【题目】 Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. For "(()", the longest valid parentheses substring i...
分类:其他好文   时间:2015-04-06 20:21:52    阅读次数:113
【哈希表】Longest Consecutive Sequence
题目:leetcode Longest Consecutive Sequence   Given an unsorted array of integers, find the length of the longest consecutive elements sequence. For example, Given [100, 4, 200, 1, 3, 2]...
分类:其他好文   时间:2015-04-06 17:22:41    阅读次数:160
Palindrome Partitioning
https://leetcode.com/problems/palindrome-partitioning/Given a strings, partitionssuch that every substring of the partition is a palindrome.Return all...
分类:其他好文   时间:2015-04-06 15:23:49    阅读次数:112
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!