# LeetCode[Math] - #9 Palindrome Number

Java - 388ms

```    public boolean isPalindrome(int x) {
if(x < 0){
return false;
}
int originNum = x;
int num = x % 10;
x = x / 10;
while(x != 0){
num *= 10;
num += x%10;
x /= 10;
}
return num==originNum;
}```

Python - 269ms

```def isPalindrome(self, x):
if (x < 0):
return False
originNum = x
num = x % 10
x /= 10;
while (x!=0):
num *= 10
num += x%10
x /= 10
return num==originNum```

LeetCode[Math] - #9 Palindrome Number

• 0

开心

• 0

板砖

• 0

感动

• 0

有用

• 0

疑问

• 0

难过

• 0

无聊

• 0

震惊

Determine whether an integer is a palindrome. Do this without extra space. Some hints: Could

【题目】 Valid Palindrome Total Accepted: 3479 Total Submissions: 16532 My Submissions Given
Given a string s, partition s such that every substring of the partition is a palindrome. Ret
1 Palindrome Partitioning 问题来源：Palindrome Partitioning 该问题简单来说就是给定一个字符串
Problem I : Palindrome Partitioning I Given a string s, partition s such that every substring
Write an algorithm to determine if a number is "happy". A happy number is a number defined by