a guest Sep 21st, 2019 99 Never
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]
RAW Paste Data