[Python 3] Save vowels and pos, sort vowels and insert in saved pos || 117ms || beats 96%
Convert string to list (because string is immutable)\n2. Iterate all symbols and save vowels and their positions\n3. Sort vowels (here also can be used Counting
1. Convert string to list (because string is immutable)\n2. Iterate all symbols and save vowels and their positions\n3. Sort vowels (here also can be used `Counting sort` to optimisation, but it\'s more hard way)\n4. Insert sorted vowels in saved positions (to simplify here using zip)\n5. Convert list back to string and return result\n```python3 []\nclass Solution:    \n    def sortVowels(self, s: str) -> str:\n        s, vowels, positions, vowSet = list(s), [], [], set([\'a\', \'e\', \'i\', \'o\', \'u\', \'A\', \'E\', \'I\', \'O\', \'U\'])\n    \n        for i, c in enumerate(s):\n            if c in vowSet:\n                vowels.append(c)\n                positions.append(i)\n        \n        vowels.sort()\n\n        for i, c in zip(positions, vowels):\n            s[i] = c\n        \n        return \'\'.join(s)\n```\n![Screenshot 2023-11-13 at 03.09.39.png](https://assets.leetcode.com/users/images/282031b9-899d-4efa-8aa7-da9d8e1b9220_1699834198.2427926.png)\n
['Sorting', 'Python', 'Python3']