Determine whether an integer is a palindrome. Do this without extra space.
class Solution {
public:
bool isPalindrome(int x) {
stringstream stream;
string res;
stream << x;
stream >> res;
for(int i = 0, j = res.size()-1; i <= j; i++, j--){
if(res[i] != res[j])
return 0;
}
return 1;
}
};