Most Simple solution with O(1) time complexity and 4 line of code in C++
In my solution I used a basic concept of Permuation and combination that we studied in 11th class for JEE exam. It is about counting the number of ways we can d
In my solution I used a basic concept of Permuation and combination that we studied in 11th class for JEE exam. It is about counting the number of ways we can distribute \'n\' identical balls in \'k\' identical boxes. \n\nx1 + x2 + x3 + .......+ xk = n\n\nand the formula for this comes out to be (n+k-1)C(k-1) \n\nSo imagine here that you need to give some chance X of chance to each vowel so that it can appear in the string X times. \n\nhence it is : Xa +Xe +Xi + Xo + Xu = n\n\nand for each case there will only be one arrangement of the accending order of the string.\n\nso in this question we need to calculate (n+4-1) C (5-1) \n\nthe following is the code that is required. (please support me by upvoting this solution \uD83D\uDE42)\n\n```\nclass Solution {\npublic:\n    int countVowelStrings(int n) {\n        int ans =1;\n        for (int i=n; i>n-4;i--){\n            ans *= (i+4);\n        }\n        return ans/24;\n    }\n};\n```\n
[]