My code is :

class Solution {

public:

bool isPalindrome(int x) {

int half_x = 0;

```
if (x < 0) {return false;}
if (x != 0 & x % 10 == 0) { return false; }
while (x > half_x) {
half_x = half_x * 10 + x % 10;
x /= 10;
}
return (x == half_x || x == half_x/10);
}
```

};

I met a Memory Limit Exceeded for 2147483647. I think I only use two extra variables and the x and half_x are only two 5-digit numbers when 2147483647 is input. Then why there is an Exceeded? Thanks in advance for any answer.