C++ Solution
Complexity
Time complexity: O(N)

Space complexity: O(1)
Code
\n# Complexity\n- Time complexity: O(N)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    string sortVowels(string s) {\n        vector<int> u(26, 0);\n        vector<int> l(26, 0);\n        string v = "AEIOUaeiou", ans = "";;\n        for (int i = 0; i < s.length(); i++) {\n            char c = s[i];\n            if (v.find(c) != string::npos) {\n                if (c >= \'a\') l[c - \'a\']++;\n                else u[c - \'A\']++;\n                s[i] = \'#\';\n            }\n        }\n        for (int i = 0; i < 26; i++) {\n            while (u[i]--) {\n                ans += \'A\' + i;\n            }\n        }\n        for (int i = 0; i < 26; i++) {\n            while (l[i]--) {\n                ans += \'a\' + i;\n            }\n        }\n        for (int i = 0, j = 0; i < s.length(); i++) {\n            if (s[i] == \'#\') {\n                s[i] = ans[j++];\n            }\n        }\n        return s;\n    }\n};\n```
['C++']