Easy Javascript solution


  • 2
    F
    var reverseWords = function(s) {
        var str = s.split(" ");
        for(let i = 0;i < str.length;i++){
            str[i] = str[i].split("").reverse().join("");
        }
        return str.join(" ");
    };
    

Log in to reply
 

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