✅C++ || Easy Recursion || Simple Explanation || 🗓️ Daily LeetCoding Challenge May, Day 11
Please Upvote If It Helps\n\n\nclass Solution {\npublic:\n    void helper(vector<char> &vowels, vector<char> &tmp, int &ans, int n, int start)\n    {\n        /
**Please Upvote If It Helps**\n\n```\nclass Solution {\npublic:\n    void helper(vector<char> &vowels, vector<char> &tmp, int &ans, int n, int start)\n    {\n        // if our tmp.size(), in which we are storing our combination reaches to the n then push that combination into our ans\n        if(n==tmp.size())\n        {\n            ans++;\n            return;\n        }\n        \n        // start viisitng all the remaining vowels with the current vowel \n\t\t// beacuse it can make combination with itself and all the right vowels also\n        // each time push current vowel to our temp and call the same function for current i\n        for(int i=start;i<vowels.size();i++)\n        {\n            tmp.push_back(vowels[i]);\n            helper(vowels,tmp,ans,n,i);\n            tmp.pop_back();                  // backtracking\n        }\n        return;\n    }\n    \n    int countVowelStrings(int n) \n    {\n        // it is the vector by which we need to create all possible combination of strings\n        vector<char> vowels = {\'a\',\'e\',\'i\',\'o\',\'u\'};\n        \n        // it will store the current string each time\n        vector<char> tmp;\n        \n        // it will store all the possible combinations count\n        int ans=0;\n        \n        // call the helper function\n        helper(vowels,tmp,ans,n,0);\n        \n        return ans;\n    }\n};\n```
[]