Open fly0o0 opened 4 years ago
151. 翻转字符串里的单词
/** * @param {string} s * @return {string} */ var reverseWords = function(s) { s = s.trim() s = s.split(/\s+/) s = s.reverse() return s.join(' ') };