Skip to content

Commit 875fe26

Browse files
authored
Create 3813. Vowel-Consonant Score.py
1 parent d31113f commit 875fe26

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class Solution:
2+
def vowelConsonantScore(self, s: str) -> int:
3+
vc = [0,0]
4+
for c in s:
5+
if c in ('a','e','i','o','u'):
6+
vc[0]+=1
7+
elif c.isalpha():
8+
vc[1]+=1
9+
return floor(vc[0]/vc[1]) if vc[1]>0 else 0

0 commit comments

Comments
 (0)