码迷,mamicode.com
首页 >  
搜索关键字:longest substring    ( 5540个结果
[LeetCode] Longest Substring with At Most Two Distinct Characters
Longest Substring with At Most Two Distinct CharactersGiven a string, find the length of the longest substring T that contains at most 2 distinct char...
分类:其他好文   时间:2015-09-06 12:38:14    阅读次数:178
leetcode - 14:Longest Common Prefix
找最长公共前缀,Longest Common Prefix,自己写的小算法,并吸取他人的精华进行改进,直接上代码,第一次写难免会有疏漏,还望大家指正 #include<iostream> #include<string> #include<vector> using?namespace...
分类:其他好文   时间:2015-09-05 18:01:36    阅读次数:153
Longest Substring Without Repeating Characters
1 class Solution { 2 public: 3 4 int lengthOfLongestSubstring(string s) { 5 // for ASCII char sequence, use this as a hashmap 6 vector...
分类:其他好文   时间:2015-09-05 12:17:57    阅读次数:127
提取URL字符串的搜索字符串中的参数
function urlArgs() { var args = []; var query = location.search.substring(1); var paris = query.split("&"); for (var i = 0, len = paris.length; i...
分类:Web程序   时间:2015-09-05 00:07:12    阅读次数:202
usaco Longest Prefix
题意是给出一些子串,用这些子串能拼出一个S的前缀来,问这个前缀最长能有多长。做法是,从S的第一个元素开始扫,到S[i]时,查看每一个长度不大于i的子串,然后检查这个子串能否和以i为结尾,长度与这个子串长度相同的S的子串匹配,若能匹配,则检查在以S[i-子串长度] 为结尾处能否找到以前匹配到S[i-子...
分类:其他好文   时间:2015-09-04 17:00:46    阅读次数:203
Codeforces Gym 100114 H. Milestones 离线树状数组
H. MilestonesTime Limit: 1 SecMemory Limit: 256 MB题目连接http://codeforces.com/gym/100114DescriptionThe longest road of the Fairy Kingdom has n milestone...
分类:编程语言   时间:2015-09-03 20:19:57    阅读次数:186
leetcode&编程之美——博文目录
leetcode刷题整理:1——Two Sum(哈希表hashtable,map)2——Add Two Numbers(链表)3——Longest Substring Without Repeating Characters(set,哈希表,两个指针)9——Palindrome Number (数学...
分类:其他好文   时间:2015-09-03 20:18:49    阅读次数:190
Longest Substrings 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...
分类:其他好文   时间:2015-09-03 01:52:10    阅读次数:287
Longest Valid Parentheses Leetcode 32 一种奇特的解法
题目:Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. For "(()", t.....
分类:其他好文   时间:2015-09-02 20:42:12    阅读次数:176
Longest Substring Without Repeating Characters
Description:Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeatin...
分类:其他好文   时间:2015-09-02 17:20:56    阅读次数:101
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!