Untitled
Anonymous
plain_text
01/25/2024 3:01 PM
272 B
12
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