码迷,mamicode.com
首页 >  
搜索关键字:longest consecutive    ( 3017个结果
leetcode 5. Longest Palindromic Substring [java]
```java public String longestPalindrome(String s) { String rs = ""; int res = 0; for(int i = 0; i= 0 && s.charAt(i) == s.charAt(left)) left --; while(... ...
分类:编程语言   时间:2019-04-06 12:25:02    阅读次数:170
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 lon ...
分类:其他好文   时间:2019-04-05 20:07:23    阅读次数:186
leetcode 3. Longest Substring Without Repeating Characters [java]
```java public int lengthOfLongestSubstring(String s) { int i = 0, j = 0, max = 0; Set set = new HashSet(); while(j ...
分类:编程语言   时间:2019-04-05 14:03:33    阅读次数:134
POJ-2533.Longest Ordered Subsequence (LIS模版题)
本题大意:和LIS一样 本题思路:用dp[ i ]保存前 i 个数中的最长递增序列的长度,则可以得出状态转移方程dp[ i ] = max(dp[ j ] + 1)(j < i) 参考代码: 1 #include <iostream> 2 #include <cstring> 3 #include ...
分类:其他好文   时间:2019-04-03 14:06:06    阅读次数:152
LeetCode 521 Longest Uncommon Subsequence I 解题报告
题目要求 Given a group of two strings, you need to find the longest uncommon subsequence of this group of two strings. The longest uncommon subsequence is ...
分类:其他好文   时间:2019-04-01 11:50:44    阅读次数:137
zoj-3790-Consecutive Blocks
使用l,r指针游动。 然后使用记录游动过程中的最大值。 我离散化了一下。 #include<stdio.h> #include<string.h> #include<algorithm> #include<iostream> #include<vector> #include<map> using ...
分类:其他好文   时间:2019-03-31 09:48:38    阅读次数:164
14. Longest Common Prefix
description: Write a function to find the longest common prefix string amongst an array of strings. 找到几个字符串的最大前缀,英语不好是硬伤gg prefix string 前缀!!!!! If th ...
分类:其他好文   时间:2019-03-30 10:19:50    阅读次数:152
【leetcode】485. Max Consecutive Ones
problem 485. Max Consecutive Ones 参考 1. Leetcode_485. Max Consecutive Ones; 完 ...
分类:其他好文   时间:2019-03-29 19:08:28    阅读次数:114
70. Climbing Stairs
网址:https://leetcode.com/problems/length-of-longest-fibonacci-subsequence/ 其实就是斐波那契数列,没什么好说的。 注意使用3个变量,而不是数组,可以节约空间。 ...
分类:其他好文   时间:2019-03-28 00:32:21    阅读次数:163
【LeetCode每天一题】Longest Substring Without Repeating Characters(最长无重复的字串)
Given a string, find the length of the longest substring without repeating characters. Example 1: Input: "abcabcbb" Output: 3 Explanation: The answer ...
分类:其他好文   时间:2019-03-27 12:29:56    阅读次数:157
3017条   上一页 1 ... 37 38 39 40 41 ... 302 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!