Skip to content

Commit 5193842

Browse files
committed
day 4
1 parent 64ef74b commit 5193842

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

557. Reverse Words in a String III.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class Solution:
2+
def reverseWords(self, s: str) -> str:
3+
s = s.split(' ')
4+
# print(type(s))
5+
for i in range(len(s)):
6+
s[i] = s[i][::-1]
7+
s = ' '.join(s)
8+
return s

0 commit comments

Comments
 (0)