[LeetCode] 557. Reverse Words in a String III
Python
class Solution:
def reverseWords(self, s: str) -> str:
temp = s.split()
for i in range(len(temp)):
temp[i] = temp[i][::-1]
return ' '.join(temp)
class Solution:
def reverseWords(self, s: str) -> str:
temp = s.split()
for i in range(len(temp)):
temp[i] = temp[i][::-1]
return ' '.join(temp)
댓글남기기