码迷,mamicode.com
首页 >  
搜索关键字:palindrome    ( 1561个结果
Palindrome number
题目要求不能用额外的空间,这样就不能将数字转成str,然后递归了(递归要用到额外的空间)。开始的想法是:把最高位的数字拿来和最低为的数字比较,若相等,则去掉最高位和最低位的数字,重复之前的操作,否则,返回False;用的方法是整除和取余,可是没有考虑到例如1000021的情况,取余后得到的是21,前...
分类:其他好文   时间:2014-08-31 11:45:21    阅读次数:203
【LeetCode】- Valid Palindrome(正确的回文)
[ 问题: ] Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. 直译:给你一个字符串, 判定它是否是回文(只统计字母、数字,其他字符请忽略)。...
分类:其他好文   时间:2014-08-28 09:45:09    阅读次数:204
【Leet Code】Palindrome Number
Palindrome Number  Total Accepted: 19369 Total Submissions: 66673My Submissions Determine whether an integer is a palindrome. Do this without extra space. 判断一个数整数是不是回文?例如121,122...
分类:其他好文   时间:2014-08-27 01:40:27    阅读次数:180
25. Valid Palindrome
思想:简单的从两端来逐个读字符,判断是否相等。(36ms)
分类:其他好文   时间:2014-08-27 01:39:08    阅读次数:155
LeetCode: Valid Palindrome
LeetCode: Valid PalindromeGiven a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example,"A...
分类:其他好文   时间:2014-08-25 22:31:25    阅读次数:216
19. Palindrome Partitioning && Palindrome Partitioning II (回文分割)
思想: 简单的深度优先搜索。 思想: 动态规划: n = s.length(); Record[i] = 0 , ( i = n || is...
分类:其他好文   时间:2014-08-25 02:17:23    阅读次数:187
LeetCode: Palindrome Partition
LeetCode: Palindrome PartitionGiven a string s, partition s such that every substring of the partition is a palindrome.Return all possible palindrome ...
分类:其他好文   时间:2014-08-24 19:21:22    阅读次数:196
hdu4731(字符串构造+找规律)
Minimum palindrome Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 780    Accepted Submission(s): 353 Problem Description Setting p...
分类:其他好文   时间:2014-08-24 18:07:43    阅读次数:176
poj1159 Palindrome(最长公共子序列)
Palindrome Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 52966   Accepted: 18271 Description A palindrome is a symmetrical string, that is, a string read i...
分类:其他好文   时间:2014-08-23 23:03:21    阅读次数:569
Palindrome Partitioning系列
Palindrome PartitioningGiven a strings, partitionssuch that every substring of the partition is a palindrome.Return all possible palindrome partitioni...
分类:其他好文   时间:2014-08-23 21:34:11    阅读次数:288
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!