码迷,mamicode.com
首页 >  
搜索关键字:longest consecutive    ( 3017个结果
最长不重复字符的子串(Leetcode Longest Substring Without Repeating Characters)
问题: 给定一个字符串,找到最长子串的长度,而不重复字符。 例子: 给定"abcabcbb"的答案是"abc",长度是3。 给定"bbbbb"的答案是"b",长度为1。 给定"pwwkew"的答案是"wke",长度为3.请注意,答案必须是子字符串,"pwke"是子序列,而不是子字符串。 解法一(超时 ...
分类:其他好文   时间:2017-09-28 14:14:57    阅读次数:175
求给定字符串中最长回文子串
5. Longest Palindromic Substring 这个是在本机测试,然后一次点亮的,嘻嘻 1 char* longestPalindrome(char* s) { 2 char *p = s; /* first char */ 3 char *left, *right; /* sto... ...
分类:其他好文   时间:2017-09-28 11:34:44    阅读次数:187
[LeetCode] Number of Longest Increasing Subsequence 最长递增序列的个数
Given an unsorted array of integers, find the number of longest increasing subsequence. Example 1: Input: [1,3,5,4,7] Output: 2 Explanation: The two l ...
分类:其他好文   时间:2017-09-27 21:48:07    阅读次数:150
2017ICPC北京赛区网络赛 Visiting Peking University(简单思维)
描述 Ming is going to travel for n days and the date of these days can be represented by n integers: 0, 1, 2, …, n-1. He plans to spend m consecutive da ...
分类:其他好文   时间:2017-09-25 21:57:14    阅读次数:183
LeetCode问题5
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. 最开始的 ...
分类:其他好文   时间:2017-09-24 23:32:21    阅读次数:271
5. Longest Palindromic Substring
中心扩散法 Spread From Center 复杂度 时间 O(n^2) 空间 O(1) 思路 动态规划虽然优化了时间,但也浪费了空间。实际上我们并不需要一直存储所有子字符串的回文情况,我们需要知道的只是中心对称的较小一层是否是回文。所以如果我们从小到大连续以某点为个中心的所有子字符串进行计算, ...
分类:其他好文   时间:2017-09-24 10:00:58    阅读次数:223
521. Longest Uncommon Subsequence I【easy】
521. Longest Uncommon Subsequence I【easy】 Given a group of two strings, you need to find the longest uncommon subsequence of this group of two strings ...
分类:其他好文   时间:2017-09-23 19:07:22    阅读次数:120
32. Longest Valid Parentheses
class Solution { public int longestValidParentheses(String s) { int left=-1; Stack stack=new Stack(); int ret=0; for(int i=0;i<s.length();i++) { ... ...
分类:其他好文   时间:2017-09-23 13:41:19    阅读次数:206
Max Consecutive Ones
这道题为简单题 题目: 思路: 这个题很简单,直接两个变量m负责加数,p负责保存最大数 代码: ...
分类:其他好文   时间:2017-09-21 22:27:40    阅读次数:230
HDU 1403 Longest Common Substring(最长公共前缀)
http://acm.hdu.edu.cn/showproblem.php?pid=1403 题意:给出两个字符串,求最长公共子串的长度。 思路: 刚开始学后缀数组,确实感觉很难,但是这东西很强大,所以必须要学会它,推荐罗穗骞大牛的论文。 ...
分类:其他好文   时间:2017-09-21 22:22:33    阅读次数:121
3017条   上一页 1 ... 95 96 97 98 99 ... 302 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!