My Java Solutions 1) DP 2) Math formula
\n\nclass Solution {\n    public int countVowelStrings(int n) {\n        // create a dp array of size 6\n        int [] dp = new int [6];\n        // dp[0] must
```\n\nclass Solution {\n    public int countVowelStrings(int n) {\n        // create a dp array of size 6\n        int [] dp = new int [6];\n        // dp[0] must be 0 and the rest 1\n        for (int i=1; i<dp.length; i++)\n            dp[i] = 1;\n        for (int i=1; i<=n; i++) {\n            for (int k=1; k<=5; k++) {\n                dp[k] += dp[k-1];\n            }\n        }\n        return dp[5];\n    }\n}\n\n\nclass Solution {\n    public int countVowelStrings(int n) {\n        // from discussions I found the answr is simply (n+4)C(4)\n        return ((n+1) * (n+2) * (n+3) * (n+4)) / 24;\n    }\n}\n```
['Math', 'Dynamic Programming', 'Java']