C# Solution for Sort Vowels In a String Problem
Intuition\n Describe your first thoughts on how to solve this problem. \nThe approach involves iterating through the characters of the input string, collecting 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nThe approach involves iterating through the characters of the input string, collecting vowels in a list, sorting the list, and then replacing the original string\u2019s vowels with the sorted ones.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n1.\tIterate through the string, identify vowels, and store them in a list.\n2.\tSort the list of vowels.\n3.\tIterate through the original string, replacing vowels with sorted vowels.\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\u2022\tIdentifying and storing vowels: O(n), where n is the length of the input string.\n\u2022\tSorting the vowel list: O(v log v), where v is the number of vowels.\n\u2022\tUpdating the string: O(n)\n\u2022\tOverall time complexity: O(n + v log v)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\u2022\tAdditional space for the vowel list: O(v)\n\u2022\tOverall space complexity: O(n + v)\n\n# Code\n```\npublic class Solution {\n    public string SortVowels(string s) {\n        char[] chars = s.ToCharArray();\n        List<char> vowels = new List<char>();\n\n        foreach (char c in chars) {\n            if (IsVowel(c)) {\n                vowels.Add(c);\n            }\n        }\n\n        vowels.Sort();\n\n        int vowelIndex = 0;\n        for (int i = 0; i < chars.Length; i++) {\n            if (IsVowel(chars[i])) {\n                chars[i] = vowels[vowelIndex++];\n            }\n        }\n\n        return new string(chars);\n    }\n\n     private bool IsVowel(char c) {\n        char lowerC = char.ToLower(c);\n        return lowerC == \'a\' || lowerC == \'e\' || lowerC == \'i\' || lowerC == \'o\' || lowerC == \'u\';\n    }\n\n}\n```
['C#']