We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 299cb00 commit 48c37d6Copy full SHA for 48c37d6
0001-500/Reverse Words in a String.py
@@ -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