Simple accepted Java solution


  • -3
    J
       public boolean isPalindrome(int x) {
            if(x<0) return false;
    		String sofx = String.valueOf(x);
    		String result = new StringBuffer(sofx).reverse().toString();
    		return sofx.equalsIgnoreCase(result);
        }

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.