码迷,mamicode.com
首页 >  
搜索关键字:palindrome    ( 1561个结果
LeetCode: Valid Palindrome [125]
【题目】Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: ...
分类:其他好文   时间:2015-06-04 17:02:05    阅读次数:105
LeetCode:Palindrome Number
基本思路:把 int 转换成string 借用stringstream 时间复杂度O(n) 1 class Solution { 2 public: 3 public: 4 bool isPalindrome(int x) { 5 6 stringstream ss; ...
分类:其他好文   时间:2015-06-03 23:22:46    阅读次数:151
Palindrome Partitioning
判断回文,简单的入栈出栈判断,其他的就是简单的回溯了。class Solution {private: vector> res; vector tempRes;public: bool isValid(string str) { stack stk; ...
分类:其他好文   时间:2015-06-02 21:26:50    阅读次数:162
LeetCode 8: Palindrome Number
Determine whether an integer is a palindrome. Do this without extra space. 本题是判断一个数是否是回文数。 代码如下: bool isPalindrome(int x) { int max = x; int min = 0; while(max >0){ ...
分类:其他好文   时间:2015-06-02 09:26:12    阅读次数:102
Java for LeetCode 132 Palindrome Partitioning II
Given a string s, partition s such that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioning ...
分类:编程语言   时间:2015-06-01 22:02:43    阅读次数:135
【palindrome partitioning II】cpp
题目:Given a strings, partitionssuch that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioning ...
分类:其他好文   时间:2015-06-01 20:16:51    阅读次数:103
Java for LeetCode 131 Palindrome Partitioning
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,...
分类:编程语言   时间:2015-06-01 20:08:32    阅读次数:138
URAL1297:Palindrome(后缀数组)
Description The “U.S. Robots” HQ has just received a rather alarming anonymous letter. It states that the agent from the competing «Robots Unlimited» has infiltrated into “U.S. Robotics”. «U.S. R...
分类:编程语言   时间:2015-05-31 01:24:51    阅读次数:160
Palindrome Number
Palindrome NumberDetermine whether an integer is a palindrome. Do this without extra space.public class Solution { public boolean isPalindrome(int ...
分类:其他好文   时间:2015-05-29 07:26:14    阅读次数:136
leetcode 9 -- Palindrome Number
Palindrome Number 题目: Determine whether an integer is a palindrome. Do this without extra space. 题意: 判断一个整数是否是回文的,要求不使用额外的空间 思路: 简单起见我用的python,先判断是否为0,或者负数,若不是则转化为字符串,然后利用切片截取两段,反转其中一个比较是...
分类:其他好文   时间:2015-05-28 09:37:01    阅读次数:125
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!