Skip to content

Instantly share code, notes, and snippets.

@cixuuz
Created October 23, 2017 18:09
Show Gist options
  • Save cixuuz/f5b253164e4844a0f398c43f112ed632 to your computer and use it in GitHub Desktop.
Save cixuuz/f5b253164e4844a0f398c43f112ed632 to your computer and use it in GitHub Desktop.
[151. Reverse Words in a String] #leetcode
class Solution(object):
def reverseWords(self, s):
"""
:type s: str
:rtype: str
"""
return " ".join(s.split()[::-1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment