C++ two solutions DP and Math
Solved LIVE ON stream, link in profile.  Math explained by a mathematician (not me) in my video\n\nHere is the DP solution:\n\nclass Solution {\n    \n    int d
**Solved LIVE ON stream, link in profile.  Math explained by a mathematician (not me) in my video**\n\nHere is the DP solution:\n```\nclass Solution {\n    \n    int dfs(int n, int i, vector<vector<int>>& memo) {\n        if(n == 0) return 1;\n        if(memo[n][i] != -1) return memo[n][i];\n        int ret = 0;\n        for(int j = i; j < 5; j++) {\n            ret += dfs(n-1, j, memo);\n        }\n        \n        return memo[n][i] = ret;\n        \n    }\n    \npublic:\n    int countVowelStrings(int n) {\n        vector<vector<int>> memo(n+1, vector<int>(5, -1));\n        return dfs(n, 0, memo);\n    }\n};\n```\n\nHere is the math... Stars n Bars:\n```\nclass Solution {\n    \npublic:\n    int countVowelStrings(int n) {\n        \n        return (n+4)*(n+3)*(n+2)*(n+1) / 24;\n    }\n};\n```\n
[]