
Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Use dynamic programming.
Let dp[i][j] be the number of strings of length i that ends with the j-th vowel.
Deduce the recurrence from the given relations between vowels.