VISUALGO//PROBLEMS
reverse words in a string · array / stringmedium
LeetCode #151
words
the
sky
is
blue
reversed
···
···
···
···
ELEMENTS
s
Python
def reverseWords(s: str) -> str:
    words = s.split()
    return ' '.join(words[::-1])