Python 1-liner just for fun


  • 0
    J

    Nothing new for this problem

    class Solution(object):
        def reverseWords(self, s):
            return ' '.join([ss.strip()[::-1] for ss in s.strip().split(' ')])

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.