Very Easy 4-line Java Code


  • 0
    H
        public boolean isPalindrome(int x) {
            if(x < 0) return false;
            return String.valueOf(x).equals(new StringBuffer(String.valueOf(x)).reverse().toString());
        }
    

Log in to reply
 

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