Sort
Python 3\nNote that we sort in reverse here, so we can use pop() efficiently.\npython\nclass Solution:\n    def sortVowels(self, s: str) -> str:\n        vw = s
**Python 3**\nNote that we sort in reverse here, so we can use `pop()` efficiently.\n```python\nclass Solution:\n    def sortVowels(self, s: str) -> str:\n        vw = sorted([c for c in s if c.lower() in \'aeiou\'], reverse=True)\n        return \'\'.join([vw.pop() if c.lower() in \'aeiou\' else c for c in s])      \n```\n**C++**\n```cpp\nbool isVowel(char ch) {\n    return ch == \'a\' || ch == \'e\' || ch == \'o\'|| ch == \'u\'|| ch == \'i\';\n}\nstring sortVowels(string s) {\n    string v;\n    copy_if(begin(s), end(s), back_inserter(v), [&](char ch){ \n        return isVowel(tolower(ch)); \n    });\n    sort(begin(v), end(v));\n    for (int i = 0, j = 0; i < s.size(); ++i)\n        if (isVowel(tolower(s[i])))\n            s[i] = v[j++];\n    return s;\n}\n```
[]