https://www.codewars.com/kata/51c8991dee245d7ddf00000e
Codewars - Achieve mastery through coding practice and developer mentorship
A coding practice website for all programming levels – Join a community of over 3 million developers and improve your coding skills in over 55 programming languages!
www.codewars.com
DESCRIPTION:
Complete the solution so that it reverses all of the words within the string passed in.
Words are separated by exactly one space and there are no leading or trailing spaces.
Example(Input --> Output):
"The greatest victory is that which requires no battle" --> "battle no requires which that is victory greatest The"
코드
function reverseWords(str){
return str.split(' ').reverse().join(' ');
}
'알고리즘 > Codewars' 카테고리의 다른 글
[Codewars] Highest Scoring Word (6 kyu) / JavaScript (0) | 2023.01.24 |
---|---|
[Codewars] Beginner - Reduce but Grow (8 kyu) / JavaScript (0) | 2023.01.23 |
[Codewars] Reversed sequence (8 kyu) / JavaScript (0) | 2023.01.20 |
[Codewars] Fake Binary (8 kyu) / JavaScript (0) | 2023.01.19 |
[Codewars] Reverse words (7 kyu) / JavaScript (0) | 2023.01.18 |
댓글