Skip to content

Commit 48c37d6

Browse files
committed
151
1 parent 299cb00 commit 48c37d6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

0001-500/Reverse Words in a String.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class Solution:
2+
def reverseWords(self, s: str) -> str:
3+
words = s.strip().split()
4+
words.reverse()
5+
return ' '.join(words)

0 commit comments

Comments
 (0)