Tap here to switch tabs
Problem
Submissions

Problem: Vowel-Consonant Score

med
30 min
Try to solve the Vowel-Consonant Score problem.

Statement

You are given a string s.

Let v be the number of vowels in s, where vowels are the characters 'a', 'e', 'i', 'o', and 'u'.

Let c be the number of consonants in s, where consonants are all other lowercase English letters.

Characters that are digits or spaces are neither vowels nor consonants.

The score of s is calculated as follows:

  • If c>0c > 0, the score is ⌊v/c⌋\lfloor v / c \rfloor.

  • If c=0c = 0, the score is 00.

Return the score of s.

Constraints:

  • 1≤1 \leq s.length ≤100\leq 100

  • s consists of lowercase English letters, spaces, and digits.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Vowel-Consonant Score

med
30 min
Try to solve the Vowel-Consonant Score problem.

Statement

You are given a string s.

Let v be the number of vowels in s, where vowels are the characters 'a', 'e', 'i', 'o', and 'u'.

Let c be the number of consonants in s, where consonants are all other lowercase English letters.

Characters that are digits or spaces are neither vowels nor consonants.

The score of s is calculated as follows:

  • If c>0c > 0, the score is ⌊v/c⌋\lfloor v / c \rfloor.

  • If c=0c = 0, the score is 00.

Return the score of s.

Constraints:

  • 1≤1 \leq s.length ≤100\leq 100

  • s consists of lowercase English letters, spaces, and digits.