#3813
Vowel-Consonant Score
pupil · 430 · lc easy +25 · 54% accepted · 48 likes · top 46%
Description
Given a string s containing lowercase letters, spaces, and digits, count its vowels as v and consonants as c. Vowels are 'a', 'e', 'i', 'o', 'u'; all other alphabet letters are consonants. Compute the score: if c > 0 then score = floor(v / c), otherwise score = 0. Return the score.
Code
1
2
3