8000 Total Runtime: 406 ms · michaelhuang/LintCode_Python@5bc4b39 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5bc4b39

Browse files
committed
1 parent b6e8c44 commit 5bc4b39

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Reverse_Words_in_String.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class Solution:
2+
# @param s : A string
3+
# @return : A string
4+
def reverseWords(self, s):
5+
return ' '.join(s.split()[::-1])

0 commit comments

Comments
 (0)
0