We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 498f44b + fa05af9 commit bce3127Copy full SHA for bce3127
go/1220-count-vowels-permutation.go
@@ -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