1
# Runtime: 249 ms (Top 78.97%) | Memory: 19.8 MB (Top 29.73%)3
def countVowelPermutation(self, n: int) -> int:4
# dp[i][j] means the number of strings of length i that ends with the j-th vowel.5
dp = [[1] * 5] + [[0] * (5) for _ in range(n - 1)]6
moduler = math.pow(10, 9) + 79
dp[i][0] = (dp[i - 1][1] + dp[i - 1][2] + dp[i - 1][4]) % moduler11
dp[i][1] = (dp[i - 1][0] + dp[i - 1][2]) % moduler13
dp[i][2] = (dp[i - 1][1] + dp[i - 1][3]) % moduler15
dp[i][3] = (dp[i - 1][2]) % moduler17
dp[i][4] = (dp[i - 1][2] + dp[i - 1][3]) % moduler19
return int(sum(dp[-1]) % moduler)