All prompts are owned by LeetCode. To view the prompt, click the title link above.
First completed : May 22, 2024
Last updated : July 01, 2024
Related Topics : Math
Acceptance Rate : 57.82 %
class Solution {
public boolean isPalindrome(int x) {
if (x < 0) {
return false;
}
int one = 0;
int two = x;
while (two > 0) {
one = 10 * one + two % 10;
two /= 10;
}
return x == one;
}
}