class Solution {
    public boolean isPalindrome(int x) {
        if (x < 0) 
            return false;
        int temp = x;
        int len = 0;
        while (temp != 0) {
            temp /= 10;
            len ++;
        }
        temp = x;
        int left, right;
        for (int i = 0; i < len / 2; i++) {
            right = temp % 10;
            left = temp / (int) Math.pow(10, len - 2 * i - 1);
            left = left % 10;
            if (left != right)
                return  false;
            temp /= 10;
        }
        return true;
    }

    // Leetcode book
    public boolean isPalindrome(int x) {
        if (x < 0) return false;
        int div = 1;
        while ( x / div >= 10) {
            div *= 10;
        }
        while (x !=0) {
            int l = x / div;
            int r = x % 10;
            if (l != r) return false;
            // Remove left and right number
            x = (x % div) / 10;
            div /= 100;
        }
        return true;
    }
}
@@ -996,8 +996,395 @@
 %0A    %7D%0A%7D
+%0A%0A// simpler code %0A%0Aclass Solution %7B%0A    public boolean isPalindrome(int x) %7B%0A        int r,s=0,number=x;%0A        if(number%3C0)%7B%0A            return false;%0A        %7D%0A        while (number!=0)%7B%0A            r=number%2510;%0A            s= s*10 +r;%0A            number/=10;%0A        %7D%0A        if (s==x)%7B%0A            return true;%0A        %7D%0A        else %7B%0A            return false;%0A        %7D%0A    %7D%0A%7D%0A

Update 009_Palindrome_Number.java (#14)