Skip to content

Commit

Permalink
Solution for Prob 151 with Python
Browse files Browse the repository at this point in the history
  • Loading branch information
ad-astra-per-ardua committed Oct 30, 2023
1 parent 04ff9ca commit 8ca2512
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Medium/151. Reverse Words in a String/Approach 1/Solution.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class Solution:
def reverseWords(self, s: str) -> str:
lists = s.split()
answer = ' '.join(lists[::-1])
return answer

0 comments on commit 8ca2512

Please sign in to comment.