From 0f7e44bb42859357d626f1c029681d28050eb9a6 Mon Sep 17 00:00:00 2001 From: dmswl6310 Date: Thu, 20 Aug 2026 16:18:00 +0900 Subject: [PATCH] 0819 --- .../3813. Vowel-Consonant Score.js" | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 "leetcode3/\355\231\251\354\235\200\354\247\200/3813. Vowel-Consonant Score.js" diff --git "a/leetcode3/\355\231\251\354\235\200\354\247\200/3813. Vowel-Consonant Score.js" "b/leetcode3/\355\231\251\354\235\200\354\247\200/3813. Vowel-Consonant Score.js" new file mode 100644 index 00000000..3401e346 --- /dev/null +++ "b/leetcode3/\355\231\251\354\235\200\354\247\200/3813. Vowel-Consonant Score.js" @@ -0,0 +1,21 @@ +/** + * @param {string} s + * @return {number} + */ +var vowelConsonantScore = function (s) { + let v = 0; + let c = 0; + for (const char of s) { + if ( + char === "a" || + char === "e" || + char === "i" || + char === "o" || + char === "u" + ) + v++; + else if (char !== " " && isNaN(char)) c++; + } + + return c > 0 ? Math.floor(v / c) : 0; +};