Javascript solution


  • 0
    C
    var reverseString = function(s) {
        var n = '';
    
        if(s === undefined) {
            return;
        }
        for(var i = s.length - 1; i >= 0; i--) {
            n += s[i];
        }
        return n;
    };
    

Log in to reply
 

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