Easy C++ code
\n\n# Approach\n Describe your approach to solving the problem. \nStore the vowels in an array and after traversing the given string sort the array of vowels.\n
\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nStore the vowels in an array and after traversing the given string sort the array of vowels.\nTake an answer string and traverse the given string. If the current character is a vowel add a vowel from the array of vowel else add the current character from string.\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(n * log(n))\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(n)\n\n# Code\n```\nclass Solution {\npublic:\n    string sortVowels(string s) {\n        vector<char>vowels;\n        for(int i=0;i<s.size();i++){\n            if(s[i]==\'a\' || s[i]==\'e\' || s[i]==\'i\' || s[i]==\'o\' || s[i]==\'u\' || s[i]==\'A\' || s[i]==\'E\' || s[i]==\'I\' || s[i]==\'O\' || s[i]==\'U\')vowels.push_back(s[i]);\n        }\n        sort(vowels.begin(),vowels.end());\n        string ans="";\n        int id=0;\n        for(int i=0;i<s.size();i++){\n            if(s[i]==\'a\' || s[i]==\'e\' || s[i]==\'i\' || s[i]==\'o\' || s[i]==\'u\' || s[i]==\'A\' || s[i]==\'E\' || s[i]==\'I\' || s[i]==\'O\' || s[i]==\'U\'){\n                ans+=vowels[id];\n                id++;\n            }\n            else ans+=s[i];\n        }\n        return ans;\n    }\n};\n```
['String', 'Sorting', 'C++']