Guest User

Untitled

a guest
Sep 21st, 2019
106
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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]
RAW Paste Data