码迷,mamicode.com
首页 >  
搜索关键字:palindrome    ( 1561个结果
Valid Palindrome
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Pana...
分类:其他好文   时间:2014-05-21 21:20:54    阅读次数:291
[leetcode]_Palindrome Number
判断integer是否为回文串(负数全部不为回文串)思路很直接,提取出integer中的每一位,一头一尾进行比较是否相同。一次AC , 直接上代码:public boolean isPalindrome(int x) { if(x = 0 && x 0){ ...
分类:其他好文   时间:2014-05-16 00:24:44    阅读次数:386
[LeetCode]Palindrome Number
Determine whether an integer is a palindrome. Do this without extra space....
分类:其他好文   时间:2014-05-15 14:38:59    阅读次数:278
LeetCode 009 Palindrome Number
【题目】 Determine whether an integer is a palindrome. Do this without extra space. 【题意】 题意判断一个整数是否是回文数 注意一下几点: 1. 不能用额外的空间 2. 负数不是回文数...
分类:其他好文   时间:2014-05-14 20:31:10    阅读次数:298
leetcode题目:Palindrome Partitioning 和Palindrome Partitioning II
题目一: Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. For example, given s = "aab", Return [ ...
分类:其他好文   时间:2014-05-14 15:10:01    阅读次数:293
leetcode -day13 Valid Palindrome & Triangle & Pascal's Triangle I II
1、 ?? Valid Palindrome Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example, "A man, a plan, a canal: Panama" is a palindrom...
分类:其他好文   时间:2014-05-13 07:06:35    阅读次数:284
Leetcode 数 Palindrome Number
本文为senlie原创,转载请保留此地址:http://blog.csdn.net/zhengsenlie Palindrome Number  Total Accepted: 12165 Total Submissions: 41736 Determine whether an integer is a palindrome. Do this wit...
分类:其他好文   时间:2014-05-13 05:28:07    阅读次数:253
leetcode -day11 Clone Graph & Palindrome Partitioning I II
1、Clone Graph Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors. OJ's undirected graph serialization: Nodes are labeled uniquely. We use # as...
分类:其他好文   时间:2014-05-09 02:17:58    阅读次数:336
HDU 1513 Palindrome(最长公共子序列)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1513解题报告:给定一个长度为n的字符串,在这个字符串中插入最少的字符使得这个字符串成为回文串,求这个最少的个数是多少?一开始以为只是一个普通的DP题,但是按照我的想法敲出来之后怎么样都W了,无奈搜了解题...
分类:其他好文   时间:2014-05-07 14:03:18    阅读次数:293
leetcode第一刷_ Palindrome Partitioning II
这道题还挺复杂的,回来看了好一会儿才想起当时怎么想的。。上道题刚说不要打表,这道题就用了打表。。 总的思路是这样的,从后面往前面打表,最后一个位置的最小分割一定是0,那往前呢,如果当前考虑的位置是start,并且substr(s, i)是回文的,那么如果已知i+1开始的分割次数,那么start这个位置的分割应该就是start原来的和i+1开始的分割次数加1之间的最小值。DP的思想,很直接。 但...
分类:其他好文   时间:2014-05-07 07:37:39    阅读次数:307
1561条   上一页 1 ... 153 154 155 156 157 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!