C++ | Dynamic Programming | 100% Faster |
\nclass Solution {\npublic:\n    int countVowelStrings(int n) {\n        vector<int> v(n+1);     v[0] = 1;\n        for(int j = 0; j < 5; ++j){\n            for
```\nclass Solution {\npublic:\n    int countVowelStrings(int n) {\n        vector<int> v(n+1);     v[0] = 1;\n        for(int j = 0; j < 5; ++j){\n            for(int i = 1; i <= n; ++i){\n                v[i] += v[i-1];\n            }\n        }\n        return v[n];\n    }\n};\n```\n\n**Result-**\n```\nRuntime: 0 ms, faster than 100.00% of C++ online submissions for Count Sorted Vowel Strings.\nMemory Usage: 6.2 MB, less than 23.22% of C++ online submissions for Count Sorted Vowel Strings.\n```
['Dynamic Programming', 'C']