One Test Case Missing

programming
Tags: #<Tag:0x00007f242262a8c0>

#1

There is no test case when the reverse of the number would overflow.


#2

can u give such case?


#3

2000000009 this is the test case.
So we should string instead of reversing the number.

#include <bits/stdc++.h>

int Solution::isPalindrome(int A) {
string s = to_string(A);
int ans = 1;
int p=0,q= s.size()-1;
for(p;p<s.size();p++,q–){
if(s.at§!=s.at(q)){
ans = 0;
break;
}
}
return ans;
}