secondary string sort and zero marker
Use a marker to avoid a second "is vowel" lookup when feeling the result string.Code
Use a marker to avoid a second "is vowel" lookup when feeling the result string.

# Code
```cpp []
class Solution {
public:
    string sortVowels(string s) {

        std::string vowels_set = "AEIOUaeiou";

        std::string vowels_only;
        vowels_only.reserve(s.size());
        for (char& ch : s) {
            if (vowels_set.contains(ch)) {
                vowels_only.push_back(ch);
                ch = 0;
            } else {
            }
        }
        std::sort(vowels_only.begin(), vowels_only.end());
        size_t vowels_index = 0;
        for (char& c : s) {
            if (!c) {
                c = vowels_only[vowels_index++];
            }
        }

        return s;
    }
};
```
['C++']