Grokking Data Structures & Algorithms for Coding Interviews
Ask Author
Back to course home

0% completed

Vote For New Content
Easy solution python

jeffrey

Dec 23, 2025

def countingSortVowels(self, s):         vowels = ["a", "e", "i", "o", "u"]         mapping = [ch for ch in s if ch.lower() in vowels]         t = ""         mapping.sort(key = lambda x: -ord(x))         print(mapping)         for ch in s:             if ch.lower() in vowels:                 t += mapping.pop()             elif ch not in vowels:                 t += ch         return t

0

0

Comments
Comments