EASY C++ SOLUTION CHECK IT OUT
PLEASE UPVOTE MY SOLUTION IF YOU LIKE IT\n# CONNECT WITH ME\n### https://www.linkedin.com/in/pratay-nandy-9ba57b229/\n#### https://www.instagram.com/pratay_nand
# **PLEASE UPVOTE MY SOLUTION IF YOU LIKE IT**\n# **CONNECT WITH ME**\n### **[https://www.linkedin.com/in/pratay-nandy-9ba57b229/]()**\n#### **[https://www.instagram.com/pratay_nandy/]()**\n\n# Approach\nThe provided C++ code defines a class `Solution` with a member function `sortVowels`. This function takes a string `s` as input, extracts the vowels from the string, sorts them in ascending order of ASCII values, and then replaces the original vowels in the string with the sorted vowels. Here\'s a breakdown of the approach:\n\n1. **Vowel Identification:**\n   - The `vowels` function checks if a given character is a vowel (either uppercase or lowercase) using a switch statement.\n\n2. **Extracting and Sorting Vowels:**\n   - Iterate through each character in the input string `s`.\n   - If the character is a vowel, add it to the `vowel` vector.\n   - After the loop, sort the `vowel` vector in ascending order based on ASCII values.\n\n3. **Replacing Original Vowels:**\n   - Iterate through each character in the original string `s`.\n   - If the character is a vowel, replace it with the corresponding vowel from the sorted `vowel` vector.\n   - Increment the index in the `vowel` vector to move to the next sorted vowel.\n\n4. **Return the Result:**\n   - Return the modified string `s` with sorted vowels.\n\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:0(NlogN)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:0(N)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n\nbool vowels(char ch )\n{\n    switch (ch)\n    {\n        case  \'A\':\n        case  \'a\':\n        case  \'E\':\n        case  \'e\':\n        case  \'I\':\n        case  \'i\':\n        case  \'O\':\n        case  \'o\':\n        case  \'U\':\n        case  \'u\':\n        return true;\n        default : \n        return false;\n    }\n    return false;\n}\n\n    string sortVowels(string s) {\n        // craeting a vector to store the vowels \n        vector<char>vowel;\n        for(char ch : s)\n        {\n            if(vowels(ch))\n            {\n                vowel.push_back(ch);\n            }\n        }\n\n        // SORTING THE VECTOR SO THAT I GET ACCORDING TO ASCII VALUE \n\n        sort(vowel.begin(),vowel.end());\n        \n        // NOW INSERTING THE VOWELS IN CORRECT POSITION \n\n        for(int i = 0 , j = 0 ; i<s.size();i++)\n        {\n            if(vowels(s[i]))\n            {\n                s[i] = vowel[j];\n                j++;\n            }\n        }\n        return s ;\n    }\n};\n```
['String', 'Sorting', 'C++']