C++ code (Explained using permutation concept, faster than 100%)
Code using permutation \nWe have total n places to fill with 5 vowels to fill with.In short we have n identical thigs to be distributed among 5 people for which
Code using permutation \nWe have total n places to fill with 5 vowels to fill with.In short we have n identical thigs to be distributed among 5 people for which the formulae is \n(n+5-1)C(5-1)= (n+4)C4=(n+1)*(n+2)*(n+3)*(n+4)/24\n```\nclass Solution {\npublic:\n    int countVowelStrings(int n) {\n        /// We can assume that there would be 4 transition states \n        /// Ie from a->e->i->o->u\n        /// and along with these transitions there would be n vowels in sorted order\n        /// hence we have total n+4 locations and after choosing 4 of them \n        /// (for the transitions to take place)\n        /// the elements at all other positions got fixed \n        /// hence the answer is n+4 C 4.\n        return (n+1)*(n+2)*(n+3)*(n+4)/24;\n    }\n};\n```\nCode using recursion :\nk denotes number of choices left for next character to be placed \nn denotes the number of characters left\nThe function is called recursively for all possible values of vowels \n```\nclass Solution {\npublic:\n    int countVowelStrings(int n,int k=5) {\n        if(k<=1)\n            return k;\n        if(n==1)\n            return k;\n        int ans=0;\n        for(int i=0;i<k;i++)\n            ans+=countVowelStrings(n-1,k-i);\n        return ans;\n    }\n};\n```
[]