[C++] Super Easy Soln, with explaination. O(n) | O(1)
After working on this problem for quite some time, I figured out the following:\n1) The vowel \'a\' always has 5 children\n2) The vowel \'e\' always has 4 child
After working on this problem for quite some time, I figured out the following:\n1) The vowel \'a\' always has 5 children\n2) The vowel \'e\' always has 4 children\n3) The vowel \'i\' always has 3 children\n4) and so on ...\n\n\n------\nSo if i was to draw a tree it would look like this:\n\n![image](https://assets.leetcode.com/users/images/e7ddc038-d84c-4687-87af-2191b1bde0cd_1607019474.8288138.png)\n\nIf you notice each layer of the tree, and analyse it we get the following arrays:\n\nDepth = 1 : [5, 4, 3, 2, 1]\nDepth = 2 : [15, 10, 6, 3, 1]\nDepth = 3 : [35, 20, 10, 4, 1]\nand so on..\n\n**At each depth the array is the presum array of the one before to it.**\n\n#### Presum function : \n```\nvoid presum(vector<int>& A)\n{\n\tfor(int i=1;i<5;++i)\n\t\tA[i] += A[i-1];\n}\n```\n\n------\n\nI will start with ``[1, 1, 1, 1, 1]``, say for layer 1.\n\n1) We run a loop from **1 to n-1**, to calculate the presum each time. \n2) Then simply find the sum of the array elements.\n\n#### Main function :\n\n```\nint countVowelStrings(int n)\n{\n\tvector<int> A(5, 1);\n\tfor(int i=1;i<n;++i)\n\t\tpresum(A);\n\n\tint sum = 0;\n\tfor(int i=0;i<5;++i)\n\t\tsum += A[i];\n\n\treturn sum;\n}\n```\n\n------\n### Full Code:\n```\nclass Solution {\npublic:\n    void presum(vector<int>& A)\n    {\n        for(int i=1;i<5;++i)\n            A[i] += A[i-1];\n    }\n    \n    int countVowelStrings(int n)\n    {\n        vector<int> A(5, 1);\n        for(int i=1;i<n;++i)\n            presum(A);\n        \n        int sum = 0;\n        for(int i=0;i<5;++i)\n            sum += A[i];\n        \n        return sum;\n    }\n};\n```\n\n*I realize that the code could be optimised a lot, but the point of this is to give a solution that makes sense to most people.*
[]