diff --git a/Reverse words in a string.py b/Reverse words in a string.py new file mode 100644 index 0000000..c001d3d --- /dev/null +++ b/Reverse words in a string.py @@ -0,0 +1,11 @@ +class Solution(object): + def reverseWords(self, s): + """ + :type s: str + :rtype: str + """ + s = s.split() + for i in range(len(s)): + s[i]=s[i][::-1] + return " ".join(s) +