Beautiful C++ solution (100% faster)
(Updated)\n\nThe variable a, e, i, o, or u means the number of strings ended with an a, e, I, o, or u with a given length.\n\nIn each iteration, we expend the l
(Updated)\n\nThe variable a, e, i, o, or u means the number of strings ended with an a, e, I, o, or u with a given length.\n\nIn each iteration, we expend the length by 1. \u2018a\u2019 can only come after string ended with \u2018a\u2019, so the number of strings ended with an \'a\' remains unchanged. \u2018e\u2019 can be added to string ended with an \u2018a\u2019 or \u2018e\u2019, so we update the length using e\u2019 = e + a. And so forth.\n\n\n```\nclass Solution {\npublic:\n    int countVowelStrings(int n) {\n        int a = 1;\n        int e = 1;\n        int i = 1;\n        int o = 1;\n        int u = 1;\n        \n        while (--n){\n            e += a;\n            i += e;\n            o += i;\n            u += o;         \n        }\n        return a + e + i + o + u;\n    }\n};\n```
['C']