Algorithms
Medium
2785
2887
Sort Vowels in a String
sort-vowels-in-a-string
"""
Given a 0-indexed string s, permute s to get a new string t such that:

 * All consonants remain in their original places. More formally, if there is an index i with 0 <= i < s.length such that s[i] is a consonant, then t[i] = s[i].
 * The vowels must be sorted in the nondecreasing order of their ASCII values. More formally, for pairs of indices i, j with 0 <= i < j < s.length such that s[i] and s[j] are vowels, then t[i] must not have a higher ASCII value than t[j].

Return the resulting string.

The vowels are 'a', 'e', 'i', 'o', and 'u', and they can appear in lowercase or uppercase. Consonants comprise all letters that are not vowels.

Example 1:

Input: s = "lEetcOde"
Output: "lEOtcede"
Explanation: 'E', 'O', and 'e' are the vowels in s; 'l', 't', 'c', and 'd' are all consonants. The vowels are sorted according to their ASCII values, and the consonants remain in the same places.

Example 2:

Input: s = "lYmpH"
Output: "lYmpH"
Explanation: There are no vowels in s (all characters in s are consonants), so we return "lYmpH".


Constraints:

 * 1 <= s.length <= 105
 * s consists only of letters of the English alphabet in uppercase and lowercase.
"""
class Solution:
    def sortVowels(self, s: str) -> str:
        
Given a 0-indexed string s, permute s to get a new string t such that:

 * All consonants remain in their original places. More formally, if there is an index i with 0 <= i < s.length such that s[i] is a consonant, then t[i] = s[i].
 * The vowels must be sorted in the nondecreasing order of their ASCII values. More formally, for pairs of indices i, j with 0 <= i < j < s.length such that s[i] and s[j] are vowels, then t[i] must not have a higher ASCII value than t[j].

Return the resulting string.

The vowels are 'a', 'e', 'i', 'o', and 'u', and they can appear in lowercase or uppercase. Consonants comprise all letters that are not vowels.

Example 1:

Input: s = "lEetcOde"
Output: "lEOtcede"
Explanation: 'E', 'O', and 'e' are the vowels in s; 'l', 't', 'c', and 'd' are all consonants. The vowels are sorted according to their ASCII values, and the consonants remain in the same places.

Example 2:

Input: s = "lYmpH"
Output: "lYmpH"
Explanation: There are no vowels in s (all characters in s are consonants), so we return "lYmpH".


Constraints:

 * 1 <= s.length <= 105
 * s consists only of letters of the English alphabet in uppercase and lowercase.


Please complete the code below to solve above prblem:
```python
class Solution:
    def sortVowels(self, s: str) -> str:
        
```

my_solution = Solution()

test_input = { "s": "lEetcOde" }
assert my_solution.sortVowels(**test_input) == "lEOtcede"

test_input = { "s": "lYmpH" }
assert my_solution.sortVowels(**test_input) == "lYmpH"

test_input = { "s": "mDVD" }
assert my_solution.sortVowels(**test_input) == "mDVD"

test_input = { "s": "xdX" }
assert my_solution.sortVowels(**test_input) == "xdX"

test_input = { "s": "xdE" }
assert my_solution.sortVowels(**test_input) == "xdE"

test_input = { "s": "RiQYo" }
assert my_solution.sortVowels(**test_input) == "RiQYo"

test_input = { "s": "LQRamBOHfq" }
assert my_solution.sortVowels(**test_input) == "LQROmBaHfq"

test_input = { "s": "UpjPbEnOj" }
assert my_solution.sortVowels(**test_input) == "EpjPbOnUj"

test_input = { "s": "ziF" }
assert my_solution.sortVowels(**test_input) == "ziF"

test_input = { "s": "WxkKdjhL" }
assert my_solution.sortVowels(**test_input) == "WxkKdjhL"

test_input = { "s": "uZcPmqAd" }
assert my_solution.sortVowels(**test_input) == "AZcPmqud"

test_input = { "s": "UjshJXjkjS" }
assert my_solution.sortVowels(**test_input) == "UjshJXjkjS"

test_input = { "s": "nElwWTQHJ" }
assert my_solution.sortVowels(**test_input) == "nElwWTQHJ"

test_input = { "s": "kwcJqvsgM" }
assert my_solution.sortVowels(**test_input) == "kwcJqvsgM"

test_input = { "s": "z" }
assert my_solution.sortVowels(**test_input) == "z"

test_input = { "s": "Pz" }
assert my_solution.sortVowels(**test_input) == "Pz"

test_input = { "s": "T" }
assert my_solution.sortVowels(**test_input) == "T"

test_input = { "s": "syRWvFi" }
assert my_solution.sortVowels(**test_input) == "syRWvFi"

test_input = { "s": "G" }
assert my_solution.sortVowels(**test_input) == "G"

test_input = { "s": "MuQYHVy" }
assert my_solution.sortVowels(**test_input) == "MuQYHVy"

test_input = { "s": "gsc" }
assert my_solution.sortVowels(**test_input) == "gsc"

test_input = { "s": "nynBd" }
assert my_solution.sortVowels(**test_input) == "nynBd"

test_input = { "s": "qUSUCJeJZt" }
assert my_solution.sortVowels(**test_input) == "qUSUCJeJZt"

test_input = { "s": "PoEvPD" }
assert my_solution.sortVowels(**test_input) == "PEovPD"

test_input = { "s": "SrSuArHDvA" }
assert my_solution.sortVowels(**test_input) == "SrSAArHDvu"

test_input = { "s": "zI" }
assert my_solution.sortVowels(**test_input) == "zI"

test_input = { "s": "zpVZt" }
assert my_solution.sortVowels(**test_input) == "zpVZt"

test_input = { "s": "dZVLG" }
assert my_solution.sortVowels(**test_input) == "dZVLG"

test_input = { "s": "EHhQZGJBbp" }
assert my_solution.sortVowels(**test_input) == "EHhQZGJBbp"

test_input = { "s": "aPLCji" }
assert my_solution.sortVowels(**test_input) == "aPLCji"

test_input = { "s": "HSe" }
assert my_solution.sortVowels(**test_input) == "HSe"

test_input = { "s": "HvDMPPU" }
assert my_solution.sortVowels(**test_input) == "HvDMPPU"

test_input = { "s": "LYACGrvJLZ" }
assert my_solution.sortVowels(**test_input) == "LYACGrvJLZ"

test_input = { "s": "RepLvwHFI" }
assert my_solution.sortVowels(**test_input) == "RIpLvwHFe"

test_input = { "s": "vjbObvLfs" }
assert my_solution.sortVowels(**test_input) == "vjbObvLfs"

test_input = { "s": "sKQwLo" }
assert my_solution.sortVowels(**test_input) == "sKQwLo"

test_input = { "s": "PoqU" }
assert my_solution.sortVowels(**test_input) == "PUqo"

test_input = { "s": "QgUxRvJTfH" }
assert my_solution.sortVowels(**test_input) == "QgUxRvJTfH"

test_input = { "s": "wUMnwnblpu" }
assert my_solution.sortVowels(**test_input) == "wUMnwnblpu"

test_input = { "s": "JpqXrPuMd" }
assert my_solution.sortVowels(**test_input) == "JpqXrPuMd"

test_input = { "s": "wdtDPSQdKl" }
assert my_solution.sortVowels(**test_input) == "wdtDPSQdKl"

test_input = { "s": "Dl" }
assert my_solution.sortVowels(**test_input) == "Dl"

test_input = { "s": "v" }
assert my_solution.sortVowels(**test_input) == "v"

test_input = { "s": "axRukCyOHm" }
assert my_solution.sortVowels(**test_input) == "OxRakCyuHm"

test_input = { "s": "sQyytiAh" }
assert my_solution.sortVowels(**test_input) == "sQyytAih"

test_input = { "s": "ieTwHeOR" }
assert my_solution.sortVowels(**test_input) == "OeTwHeiR"

test_input = { "s": "LLxyZ" }
assert my_solution.sortVowels(**test_input) == "LLxyZ"

test_input = { "s": "s" }
assert my_solution.sortVowels(**test_input) == "s"

test_input = { "s": "oefu" }
assert my_solution.sortVowels(**test_input) == "eofu"

test_input = { "s": "XV" }
assert my_solution.sortVowels(**test_input) == "XV"

test_input = { "s": "VkfjDpSH" }
assert my_solution.sortVowels(**test_input) == "VkfjDpSH"

test_input = { "s": "rg" }
assert my_solution.sortVowels(**test_input) == "rg"

test_input = { "s": "ecV" }
assert my_solution.sortVowels(**test_input) == "ecV"

test_input = { "s": "RUnxytMua" }
assert my_solution.sortVowels(**test_input) == "RUnxytMau"

test_input = { "s": "gUyMeyzOZo" }
assert my_solution.sortVowels(**test_input) == "gOyMUyzeZo"

test_input = { "s": "WEir" }
assert my_solution.sortVowels(**test_input) == "WEir"

test_input = { "s": "zZWs" }
assert my_solution.sortVowels(**test_input) == "zZWs"

test_input = { "s": "WULsDqIhp" }
assert my_solution.sortVowels(**test_input) == "WILsDqUhp"

test_input = { "s": "pw" }
assert my_solution.sortVowels(**test_input) == "pw"

test_input = { "s": "nOWxdSzo" }
assert my_solution.sortVowels(**test_input) == "nOWxdSzo"

test_input = { "s": "NfK" }
assert my_solution.sortVowels(**test_input) == "NfK"

test_input = { "s": "wXRFu" }
assert my_solution.sortVowels(**test_input) == "wXRFu"

test_input = { "s": "XXtjDoinAD" }
assert my_solution.sortVowels(**test_input) == "XXtjDAinoD"

test_input = { "s": "SGUzEv" }
assert my_solution.sortVowels(**test_input) == "SGEzUv"

test_input = { "s": "RFOvEt" }
assert my_solution.sortVowels(**test_input) == "RFEvOt"

test_input = { "s": "umQePdr" }
assert my_solution.sortVowels(**test_input) == "emQuPdr"

test_input = { "s": "wRqZ" }
assert my_solution.sortVowels(**test_input) == "wRqZ"

test_input = { "s": "blu" }
assert my_solution.sortVowels(**test_input) == "blu"

test_input = { "s": "QeOQEatFaW" }
assert my_solution.sortVowels(**test_input) == "QEOQaatFeW"

test_input = { "s": "jzWiXrYa" }
assert my_solution.sortVowels(**test_input) == "jzWaXrYi"

test_input = { "s": "xs" }
assert my_solution.sortVowels(**test_input) == "xs"

test_input = { "s": "DwROc" }
assert my_solution.sortVowels(**test_input) == "DwROc"

test_input = { "s": "XMhLlJd" }
assert my_solution.sortVowels(**test_input) == "XMhLlJd"

test_input = { "s": "uAmir" }
assert my_solution.sortVowels(**test_input) == "Aimur"

test_input = { "s": "PTlFpeAI" }
assert my_solution.sortVowels(**test_input) == "PTlFpAIe"

test_input = { "s": "XLYy" }
assert my_solution.sortVowels(**test_input) == "XLYy"

test_input = { "s": "vA" }
assert my_solution.sortVowels(**test_input) == "vA"

test_input = { "s": "y" }
assert my_solution.sortVowels(**test_input) == "y"

test_input = { "s": "C" }
assert my_solution.sortVowels(**test_input) == "C"

test_input = { "s": "wrnMlek" }
assert my_solution.sortVowels(**test_input) == "wrnMlek"

test_input = { "s": "JWbfCfGgf" }
assert my_solution.sortVowels(**test_input) == "JWbfCfGgf"

test_input = { "s": "OPGlnq" }
assert my_solution.sortVowels(**test_input) == "OPGlnq"

test_input = { "s": "DeOMW" }
assert my_solution.sortVowels(**test_input) == "DOeMW"

test_input = { "s": "xG" }
assert my_solution.sortVowels(**test_input) == "xG"

test_input = { "s": "ZcaBhfkWC" }
assert my_solution.sortVowels(**test_input) == "ZcaBhfkWC"

test_input = { "s": "pKa" }
assert my_solution.sortVowels(**test_input) == "pKa"

test_input = { "s": "DXSEKrfJCe" }
assert my_solution.sortVowels(**test_input) == "DXSEKrfJCe"

test_input = { "s": "xA" }
assert my_solution.sortVowels(**test_input) == "xA"

test_input = { "s": "Jb" }
assert my_solution.sortVowels(**test_input) == "Jb"

test_input = { "s": "SBQT" }
assert my_solution.sortVowels(**test_input) == "SBQT"

test_input = { "s": "LWRfYb" }
assert my_solution.sortVowels(**test_input) == "LWRfYb"

test_input = { "s": "tvLWAeGDFK" }
assert my_solution.sortVowels(**test_input) == "tvLWAeGDFK"

test_input = { "s": "jFkj" }
assert my_solution.sortVowels(**test_input) == "jFkj"

test_input = { "s": "zC" }
assert my_solution.sortVowels(**test_input) == "zC"

test_input = { "s": "ikYSsAveh" }
assert my_solution.sortVowels(**test_input) == "AkYSsevih"

test_input = { "s": "YXkS" }
assert my_solution.sortVowels(**test_input) == "YXkS"

test_input = { "s": "SOEo" }
assert my_solution.sortVowels(**test_input) == "SEOo"

test_input = { "s": "qoJx" }
assert my_solution.sortVowels(**test_input) == "qoJx"

test_input = { "s": "qGJbgTQ" }
assert my_solution.sortVowels(**test_input) == "qGJbgTQ"

test_input = { "s": "yiYYO" }
assert my_solution.sortVowels(**test_input) == "yOYYi"