码迷,mamicode.com
首页 >  
搜索关键字:longest palindromic    ( 2914个结果
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
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
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
1024 Palindromic Number [模拟]
这题写的比较匆忙,代码有点乱,仅供参考。有个坑就是一开始给的数字就是回文串,要先判断,注意一下。 #include <iostream> #include <string.h> #include <cstdio> #include <algorithm> #include <cstdlib> #in ...
分类:其他好文   时间:2019-03-24 18:48:17    阅读次数:83
873. Length of Longest Fibonacci Subsequence
A sequence X_1, X_2, ..., X_n is fibonacci-like if: n >= 3 X_i + X_{i+1} = X_{i+2} for all i + 2 <= n Given a strictly increasing array A of positive ...
分类:其他好文   时间:2019-03-23 12:58:30    阅读次数:118
2914条   上一页 1 ... 37 38 39 40 41 ... 292 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!