@@ -0,0 +1,1309 @@
+/**%0A *%09Determine whether an integer is a palindrome. Do this without extra space.%0A *%0A *%09click to show spoilers.%0A *%0A *%09Some hints:%0A *%09Could negative integers be palindromes? (ie, -1)%0A *%0A *%09If you are thinking of converting the integer to string, note the restriction of using extra space.%0A *%09%0A *%09You could also try reversing an integer. However, if you have solved the problem %22Reverse Integer%22, %0A * %09you know that the reversed integer might overflow. How would you handle such case?%0A *%0A *%09There is a more generic way of solving this problem.%0A *%0A *%09Author: matao%0A *%0A */%0A%0Apublic class PalindromeNumber %7B%0A%09public static boolean isPalindrome(int x) %7B%0A    %09if(x %3C 0) %7B%0A    %09%09return false;%0A    %09%7D   %0A    %09int len = 1;%0A    %09int temp = x;%0A    %09while(temp / 10 != 0) %7B%0A    %09%09len *= 10;%0A    %09%09temp /= 10;%0A    %09%7D%0A    %09while(x != 0) %7B%0A    %09%09int i = x / len;%0A    %09%09int j = x %25 10;%0A    %09%09if(i != j) %7B%0A    %09%09%09return false;%0A    %09%09%7D%0A    %09%09x = x %25 len; //%E5%8E%BB%E6%8E%89%E6%9C%80%E9%AB%98%E4%BD%8D%0A    %09%09x = x / 10;  //%E5%8E%BB%E6%8E%89%E6%9C%80%E4%BD%8E%E4%BD%8D%0A    %09%09len /= 100;%0A    %09%7D%0A    %09return true;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A    %09System.out.println(isPalindrome(121));%0A    %09System.out.println(isPalindrome(1234321));%0A    %09System.out.println(isPalindrome(-1234321));%0A    %09System.out.println(isPalindrome(2147447412));%0A    %09System.out.println(isPalindrome(2142));%0A    %7D%0A%7D

add Palindrome Number solution