Description
Given integer n, count strings of length n consisting only of vowels (a, e, i, o, u) that follow specific transition rules between consecutive characters.
Examples
Input:
n = 1Output:
5Explanation:
a, e, i, o, u.
Input:
n = 3Output:
19Explanation:
Following vowel transition rules (a→e, e→a/i, i→a/e/o/u, o→i/u, u→a), there are 19 valid strings of length 3.
Input:
n = 4Output:
35Explanation:
Applying the vowel transition rules through 4 positions yields 35 valid strings.
Constraints
- •
1 ≤ n ≤ 2 × 10⁴