Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution:
- def reverseWords(self, s: List[str]) -> None:
- """
- Do not return anything, modify s in-place instead.
- """
- ns = "".join(s)
- arr = ns.split(' ')
- arr = arr[::-1]
- ns = " ".join(arr)
- for i in range(len(ns)):
- s[i] = ns[i]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement