JavaScript solution


  • 0
    E

    var reverseString = function(s) {
    var i = 0, len = s.length, s1 = "";
    for (i = 0; i < len; ++i) {
    s1 += s.charAt(len - (i + 1));
    }

    return s1;
    };


Log in to reply
 

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