Untitled
unknown
plain_text
2 years ago
203 B
4
Indexable
class Solution {
public:
bool isPalindrome(int x) {
long n=x;
long sum=0;
while(x>0){
sum=sum*10+x%10;
x/=10;
}
return sum==n;
}
};Editor is loading...
Leave a Comment