🔥Clean Code | EASY | C++ |
Code\n\nclass Solution {\npublic:\n    string sortVowels(string s) {\n        deque<char> vowels;\n\n        for (int i = 0; i < s.size(); i++)\n        {\n    
# Code\n```\nclass Solution {\npublic:\n    string sortVowels(string s) {\n        deque<char> vowels;\n\n        for (int i = 0; i < s.size(); i++)\n        {\n            if (string("aeiouAEIOU").find(s[i]) != string::npos)\n            {\n                vowels.push_back(s[i]);\n            }\n        }\n        \n        sort(vowels.begin(), vowels.end());\n\n        string ans;\n        for (auto c: s)\n        {\n            if (string("aeiouAEIOU").find(c) != string::npos) \n            {\n                ans += vowels.front();\n                vowels.pop_front();\n            } \n            else \n            {\n                ans += c;\n            }\n        }\n\n        return ans;\n    }\n};\n```
['C++']