Skip to content

Commit bce3127

Browse files
authored
Merge pull request neetcode-gh#1635 from tahsintunan/1220
Create 1220. Count Vowels Permutation
2 parents 498f44b + fa05af9 commit bce3127

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const mod = 1_000_000_007
2+
3+
func countVowelPermutation(n int) int {
4+
a, e, i, o, u := 1, 1, 1, 1, 1
5+
for k := 0; k < n-1; k++ {
6+
a, e, i, o, u = e%mod, (a+i)%mod, (a+e+o+u)%mod, (i+u)%mod, a%mod
7+
}
8+
return (a + e + i + o + u) % mod
9+
}

0 commit comments

Comments
 (0)