One line of Java


  • 0
    L

    try {return Integer.parseInt(new StringBuffer(Integer.toString(Math.abs(x))).reverse().toString())*(0 < x ? 1 : -1);} catch(NumberFormatException ex){return 0;}}}


Log in to reply
 

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