Sorting Solution
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\nwe will extract all Vowels from string and copy in new vector of char or 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\nwe will extract all Vowels from string and copy in new vector of char or in a new string and sort them then we will have the sorted vowel character so now will have to insert the all vowel char into our source string so we will insert one by one from start in given string according to which come first while traversing the string.\n\n# Complexity\n- Time complexity:\nn(log n)\n\n- Space complexity:\no(n)\n\n# Code\n```\nclass Solution {\npublic:\nbool is_vowel(char ch){\n    if(ch==\'a\' || ch==\'e\' || ch==\'i\' || ch==\'o\' || ch==\'u\'){\n        return true;\n    }\n    else if(ch==\'A\' || ch==\'E\' || ch==\'I\' || ch==\'O\' || ch==\'U\'){\n        return true;\n    }\n    else{\n        return false;\n    }\n}\n    string sortVowels(string s) {\n\n         <!-- brute force (n^2) solution:- -->\n\n         int n=s.length();\n         for(int i=0;i<n;i++){\n         char ch=s[i];\n             int maxi=int(ch);\n             if(is_vowel(ch)){\n                int index=i;\n                for(int j=i+1;j<n;j++){\n                     if(maxi>int(s[j]) && is_vowel(s[j])){\n                         maxi=int(s[j]);\n                         index=j;\n                     }\n                 }\n                swap(s[i],s[index]);\n             }\n         }\n         return s;\n        \n        <!--n(logn) solution  -->\n\n        set<char>st={\'a\',\'e\',\'o\',\'u\',\'i\',\'A\',\'E\',\'O\',\'U\',\'I\'};\n        int n=s.length();\n        vector<char>v;\n        for(int i=0;i<n;i++){\n            if(st.find(s[i])!=st.end()){\n               v.push_back(s[i]);\n            }\n        }\n        sort(v.begin(),v.end());\n        int start=0;\n        int end=v.size();\n        for(int i=0;i<n;i++){\n            if(st.find(s[i])!=st.end()){\n                s[i]=v[start];\n                start++;\n            }\n        }\n        return s;\n    }\n};\n```
['C++']