[C++] O(1), 1 Line Code | SIMPLEST SOLUTION
\nclass Solution {\npublic:\n    int countVowelStrings(int n) {\n        \n        return ((n+4)*(n+3)*(n+2)*(n+1))/24;\n        \n    }\n};\n\n\nExplanation :\
```\nclass Solution {\npublic:\n    int countVowelStrings(int n) {\n        \n        return ((n+4)*(n+3)*(n+2)*(n+1))/24;\n        \n    }\n};\n```\n\n**Explanation :**\n\nThink of the problem in this way. We have 5 objects and n slots to fill with these 5 objects (a,e,i,o,u). Objects can be repeated. Since we want only lexicographically smallest solution, we consider each combination as one solution only. \n\nSo, say p number of "a", q number of "e", r number of "i", s number of "o", t number of "u" we want to fill. Then it must happen that p+q+r+s+t = n\n\nAssume we have n stars, we want to split them into 5 segments, so for that we want to place 4 bars in between the stars.\nFor eg: n=12\nOne possible combination of bars and stars could be |***|***|***|***\nNow this is just one such combination where p=0, q=3, r=3, s=3, t=3.\nBut with these n stars and 4 bars, we can in total form (n+4)! permutations... out of which there are (n+4)!/(n!\\*4!) unique combinations.\n\nSo the answer is just (n+4)!/(n!\\*4!) = ((n+4)\\*(n+3)\\*(n+2)\\*(n+1))/24.\n\nPlease upvote if you found this helpful :)\n\n
['Math', 'Probability and Statistics']