Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
203 B
0
Indexable
Never
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;
    }
};
Leave a Comment