class Solution:
    def reverseWords(self, s: str) -> str:
        s = s.strip()
        arr = []
        for val in s.split(" "):
            if val != '':
                arr.append(val)
        
        return ' '.join(arr[::-1])
                

f8d08174765427f792f99df8779c6f5afe564e8e
<mask token>

class Solution:
    <mask token>

class Solution:

    def reverseWords(self, s: str) ->str:
        s = s.strip()
        arr = []
        for val in s.split(' '):
            if val != '':
                arr.append(val)
        return ' '.join(arr[::-1])

class Solution:
    def reverseWords(self, s: str) -> str:
        s = s.strip()
        arr = []
        for val in s.split(" "):
            if val != '':
                arr.append(val)
        
        return ' '.join(arr[::-1])
                
