This smart implementation shows up in several places but not in this discussion forum. So I post it here in case anyone finds it useful. Detailed explanation and references can be found in my blog.

```
class Solution {
public:
bool isPalindrome(int x) {
return isPalindromeHelper(x, x);
}
bool isPalindromeHelper(int x, int &y) {
if (x < 0) return false;
if (x == 0) return true;
/**
* as call stack goes up,
* x % 10 outputs digits from highest to lowest
* y % 10 outputs digits from lowest to highest
*/
if (isPalindromeHelper(x / 10, y) && (x % 10 == y % 10)) {
y /= 10;
return true;
} else {
return false;
}
}
};
```