Description
Given an integer n, return the number of strings of length n that consist only of vowels and are lexicographically sorted.
Examples
Input:
n = 2Output:
15Explanation:
aa,ae,ai,ao,au,ee,ei,eo,eu,ii,io,iu,oo,ou,uu.
Input:
n = 1Output:
5Explanation:
Edge case with minimal input.
Input:
n = 3Output:
35Explanation:
For length 3, the requirement is 3 vowels in non-decreasing order. Examples include: aaa, aae, aai, aao, aau, aee, aei, aeo, aeu, aii, aio, aiu, aoo, aou, auu, eee, eei, eeo, eeu, eii, eio, eiu, eoo, eou, euu, iii, iio, iiu, ioo, iou, iuu, ooo, oou, ouu, uuu. This demonstrates how the count grows significantly as n increases due to the combinatorial nature of the problem.
Constraints
- •
1 ≤ n ≤ 50