Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1e0d31b

Browse files
authoredNov 13, 2022
Create Reverse Words in a String.py
1 parent 914e220 commit 1e0d31b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎medium/Reverse Words in a String.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#151. Reverse Words in a String
2+
class Solution:
3+
def reverseWords(self, s: str) -> str:
4+
return ' '.join(reversed(s.split()))

0 commit comments

Comments
 (0)
Please sign in to comment.