Advertisement
Guest User

Untitled

a guest
Sep 21st, 2019
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. class Solution:
  2. def reverseWords(self, s: List[str]) -> None:
  3. """
  4. Do not return anything, modify s in-place instead.
  5. """
  6.  
  7. ns = "".join(s)
  8. arr = ns.split(' ')
  9. arr = arr[::-1]
  10. ns = " ".join(arr)
  11. for i in range(len(ns)):
  12. s[i] = ns[i]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement