A chant is a string of length n over the five vowels a e i o u. A chant is ordered if its letters never go backwards in the alphabet: every letter is the same as or later than the letter before it (so aeu and iii are ordered, ea is not). Return the number of ordered chants of length n. The empty chant (n = 0) counts as one ordered chant.
Examples
Input: n = 1
Output: 5
Input: n = 3
Output: 35
Explanation: 15 of them start with a (aaa, aae, ..., auu), 10 with e, 6 with i, 3 with o and 1 (uuu) with u.
Constraints
0 <= n <= 10**5- Target complexity: O(n) time; the exact count is required (Python integers are unbounded).
Goals
- Count sorted strings with a small fixed-size state per position
- Use running (prefix) sums so each step costs constant work