Determine whether an integer is a palindrome. Do this without extra space. 题目含义:不要使用额外空间,判断整数是否为回文 ...
分类:
其他好文 时间:
2017-10-20 21:44:22
阅读次数:
211
题目: Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. For ex ...
分类:
编程语言 时间:
2017-10-17 15:02:23
阅读次数:
163
1、Quasi-palindrome 题意:问一个字符串(你可以添加前导‘0’或不添加)是否是回文串 思路:将给定的字符串的前缀‘0’和后缀‘0’都去掉,然后看其是否为回文串 1 #include<iostream> 2 using namespace std; 3 int main() 4 { 5 ...
分类:
其他好文 时间:
2017-10-17 01:08:57
阅读次数:
217
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example,"A man, a plan, a canal: Pan ...
分类:
其他好文 时间:
2017-10-16 23:35:07
阅读次数:
383
1205 - Palindromic Numbers PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB A palindromic number or numeral palindrome is a ...
分类:
其他好文 时间:
2017-10-15 22:25:59
阅读次数:
240
题意:给定一个字符串,问它的集合中有多少个回文串。 析:dp[i][j] 表示区间 i 到 j,有多少个回文串, 如果 s[i] == s[j] dp[i][j] = dp[i+1][j] + dp[i][j-1] + 1。 否则 dp[i][j] = dp[i+1][j] + dp[i][j-1] ...
分类:
其他好文 时间:
2017-10-15 19:41:21
阅读次数:
148
Find the largest palindrome made from the product of two n-digit numbers. Since the result could be very large, you should return the largest palindro ...
分类:
其他好文 时间:
2017-10-10 13:16:58
阅读次数:
132
9. Palindrome Number Determine whether an integer is a palindrome. Do this without extra space. click to show spoilers. Some hints: Could negative int ...
分类:
其他好文 时间:
2017-10-09 14:20:54
阅读次数:
153
class Solution { public int minCut(String s) { int[] dp=new int[s.length()+1]; for(int i=0;i=0&&i+len=0&&i+len<s.length()&&s.charAt(i-1-len)==s.charAt... ...
分类:
其他好文 时间:
2017-10-05 11:02:55
阅读次数:
115
class Solution { public List> partition(String s) { List> res=new ArrayList>(); generatePartition(0,new ArrayList(),res,s); return res; } private void... ...
分类:
其他好文 时间:
2017-10-05 11:02:25
阅读次数:
143