Free written solutionCount Vowels Permutation (LeetCode 1220): Solution and Explanation
Count the strings of length n built from the vowels a, e, i, o, u where each vowel may only be followed by certain others. Return the count modulo 10^9 + 7.
Read the intuition, approach, code and complexity →