Using simple for loop and if condition..
Intuition\nsorting vowels replacing their position as sorted elements without affecting consonant elements\n\n# Approach\n-First I have seperated Vowels str:s a
# Intuition\nsorting vowels replacing their position as sorted elements without affecting consonant elements\n\n# Approach\n-First I have seperated Vowels str:s and stored it in a list \'D\' and sorted it\n- Next, Created a list \'L\' , which contains 0 of len(s),\n- Next, in for loop, I have created C=0 for addressing List "D" , i have compared if s[i] is vowel, if it is true,and i will update that element in list \'L\' of position \'i\' with D[C] element and i will increment "C" or else L[i] will be updated using s[i]\'s element. \n# Complexity\n- Time Complexity: O(n * log(n))\n- Space Complexity: O(n)\n# Code\n```\nclass Solution:\n    def sortVowels(self, s: str) -> str:\n        Vowel=["A","E","I","O","U","a","e","i","o","u"]\n        D=[]\n        C=0\n        for i in s:\n            if i in Vowel:\n                D.append(i)\n            else:\n                continue\n        D.sort()\n        L=[0]*len(s)\n        for i in range(len(s)):\n            if s[i] in Vowel:\n                L[i]=D[C]\n                C+=1 \n            else:\n                L[i]=s[i]\n                continue\n        return "".join(L)\n        \n```
['Python3']