JAVA 1-D DP beat 100% with explainations
\n    public int countVowelStrings(int n) {\n        // dp[i][j]: for first i vowels of length j, what is the unique lexicon pattern count\n        // divid int
```\n    public int countVowelStrings(int n) {\n        // dp[i][j]: for first i vowels of length j, what is the unique lexicon pattern count\n        // divid into two groups, one with only i - vowels dp[i-1][j], the other that must contain at least 1 i-th vowel\n        // the second group\'s last letter must be i-th vowel, because they all unique, the count of them is actually\n        // dp[i][j - 1];\n        // transformation func: dp[i][j] = dp[i -1][j] + dp[i][j-1]\n        // for init, dp[1][*] = 1, dp[1][0] = 1\n        // we can transfer the problem into 1-D dp, so dp[i] += dp[i - 1], scan from left to right\n        // for init dp[0] = 1\n        int[] dp = new int[n + 1];\n        dp[0] = 1;\n        for (int i = 0; i < 5; i++) {\n            for (int j = 1; j <= n; j++) {\n                dp[j] += dp[j - 1];\n            }\n        }\n        return dp[n];\n        \n    }\n```
[]