2 line simple python solution


  • 0
    A
        def reverseVowels(self, s):
            vowel = [ch for ch in s if ch in 'aeiouAEIOU']
            return ''.join([vowel.pop() if ch in 'aeiouAEIOU' else ch for ch in s])
    

Log in to reply
 

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