Reverse the word order · 단어 순서 뒤집기
Reverse the word order
Given a sentence of space-separated words, return the words in reverse order: the quick brown → brown quick the. Split on spaces with s.split(" "), then build the result from the last word to the first. A StringBuilder is the tidy way to join them.
단어 순서 뒤집기
공백으로 구분된 단어들의 문장이 주어졌을 때, 반대 순서로 단어를 반환합니다: the quick brown → brown quick the. s.split(" ")로 공백 기준으로 쪼갠 후, 마지막 단어부터 첫 번째单词依次构建结果。A StringBuilder is the tidy way to join them.
Complete reverseWords(String s) so it returns the space-separated words in reverse order. Example: the quick brown becomes brown quick the. · reverseWords(String s)를 완성하여 공백으로 구분된 단어들을 역순으로 반환하도록 하십시오. 예시: the quick brown이 brown quick the로 바뀝니다.
Click Run to see the output here. · 출력을 보려면 '실행'을 클릭하세요.