❇sort-vowels-in-string👌 🏆O(N)❤️ Javascript❤️ Runtime 👀100.00%🕕 Meaningful Vars✍️ 🔴🔥 ✅ 👉 💪🙏
Time Complexity: O(N)\nSpace Complexity: O(97)~=O(1)\n\nfunction isVowel(element) {\n    if (\n        element === \'a\' ||\n        element === \'e\' ||\n     
Time Complexity: O(N)\nSpace Complexity: O(97)~=O(1)\n```\nfunction isVowel(element) {\n    if (\n        element === \'a\' ||\n        element === \'e\' ||\n        element === \'i\' ||\n        element === \'o\' ||\n        element === \'u\' ||\n        element === \'A\' ||\n        element === \'E\' ||\n        element === \'I\' ||\n        element === \'O\' ||\n        element === \'U\'\n    ) {\n        return true;\n    }\n}\n\nvar sortVowels = function(s) {\n    const asciiStorage = [];\n    for (let index = 0; index < s.length; index++) {\n        const element = s[index];\n        if (isVowel(element)) {\n            const charCodeAt = s.charCodeAt(index);\n            if (!asciiStorage[charCodeAt]) {\n                asciiStorage[charCodeAt] = 0;\n            }\n            asciiStorage[charCodeAt] += 1;\n        }\n    }\n    let outputAsciiIndexStore = [];\n    for (let index = 65; index < asciiStorage.length; index++) {\n        if (asciiStorage[index]) {\n            let store = asciiStorage[index];\n            while (store--) {\n                outputAsciiIndexStore.push(index);\n            }\n        }\n    }\n    let tempIndex = 0;\n    const splittedString = s.split(\'\');\n    for (let index = 0; index < splittedString.length; index++) {\n        const element = splittedString[index];\n        if (isVowel(element)) {\n            splittedString[index] = String.fromCharCode(outputAsciiIndexStore[tempIndex++]);\n        }\n    }\n    return splittedString.join(\'\');\n};\n```\n![image](https://assets.leetcode.com/users/images/6f1f5634-f2b0-4b20-b89e-08d15aa85563_1693195322.6040628.png)\n
['JavaScript']