码迷,mamicode.com
首页 >  
搜索关键字:palindrome partition    ( 4210个结果
Leetcode--easy系列1
#6 ZigZag Conversion The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)...
分类:其他好文   时间:2015-06-22 22:25:11    阅读次数:181
Leetcode 86 Partition List
Given a linked list and a valuex, partition it such that all nodes less thanxcome before nodes greater than or equal tox.You should preserve the origi...
分类:其他好文   时间:2015-06-22 20:38:42    阅读次数:156
!HDU 1513 Palindrome--dp--(最长公共子序列模型)
题意:给定一个字符序列,求最少添加多少个字符能让它变成对称序列 分析:这题的做法竟然是把序列颠倒之后求最长公共子序列,然后n-dp[n][n]就是答案。记住这种做法。          在这里再说一次最长公共子序列的做法:dp[i][j]表示序列1的前i个字符和序列2的前j个字符比较时的最长公共子序列的长度,状态转移公式:1.当a[i]==b[j]时,dp[i][j]=dp[i-1][j-1]...
分类:其他好文   时间:2015-06-21 21:11:44    阅读次数:123
leetcode | Valid Palindrome
Valid Palindrome : https://leetcode.com/problems/valid-palindrome/Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example, “A man, a pl...
分类:其他好文   时间:2015-06-21 18:34:26    阅读次数:110
Valid Palindrome
Description:Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a...
分类:其他好文   时间:2015-06-21 17:14:49    阅读次数:93
#9 Palindrome Number
题目链接:https://leetcode.com/problems/palindrome-number/ Determine whether an integer is a palindrome. Do this without extra space. click to show spoilers. Some hints: Could negative inte...
分类:其他好文   时间:2015-06-21 15:52:27    阅读次数:145
Leetcode 9 Palindrome Number
Determine whether an integer is a palindrome. Do this without extra space.利用余数构造倒置数再判断。var isPalindrome = function(x) { var y = 0 var t = x w...
分类:其他好文   时间:2015-06-20 23:30:33    阅读次数:317
[转]O(n)回文子串算法 Manacher算法
这里,我介绍一下O(n)回文串处理的一种方法。Manacher算法.原文地址:http://zhuhongcheng.wordpress.com/2009/08/02/a-simple-linear-time-algorithm-for-finding-longest-palindrome-sub....
分类:编程语言   时间:2015-06-20 13:08:23    阅读次数:192
LeetCode——Valid Palindrome
Description:Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example, "A man, a plan, ...
分类:其他好文   时间:2015-06-19 22:59:13    阅读次数:165
[LeetCode-JAVA] Shortest Palindrome
题目:Given a string S, you are allowed to convert it to a palindrome by adding characters in front of it. Find and return the shortest palindrome you ca...
分类:编程语言   时间:2015-06-18 23:42:31    阅读次数:198
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!