Solution in JS


  • 0
    K
    var reverse = function(x) {
        const reversed = x.toString().split('').reverse().join('');
        
        return parseInt(reversed) * Math.sign(x);
    };
    

Log in to reply
 

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