1641. Count Sorted Vowel Strings
On This Page
class Solution:
def countVowelStrings(self, n: int) -> int:
f = [1] * 5
for _ in range(n - 1):
s = 0
for j in range(5):
s += f[j]
f[j] = s
return sum(f)