Compare the pair numbers of left side and right side respectively.

```
class Solution {
public:
bool isPalindrome(int x) {
if(x < 0) return false;
int m = x, n = x;
int count = 0;
int ld, rd;
while(m != 0) {
m /= 10;
count++;
}
m = x;
for(int i = 0; i < count; i++) {
rd = m % 10;
m /= 10;
for(int j = count - i - 1; j > 0; j--) {
n /= 10;
}
ld = n % 10;
n = x;
if(rd != ld) return false;
}
return true;
}
};
```