Python one line (math.comb) - with explanation updated
Idea: \n\nWe can simplify the question to how many "vowel"-ending strings at each n. \n"-e" at n = 2: "ae", "ee"\n\nLet\'s see how many "vowel"-ending strings p
**Idea**: \n\nWe can simplify the question to how many "vowel"-ending strings at each n. \n"-e" at n = 2: "ae", "ee"\n\nLet\'s see how many "vowel"-ending strings possible at n:\n\nEx:\n```\nn  =   1  2  3  4  5  \n------------------------\n"-a":  1  1  1  1  1  \n"-e":  1  2  3  4  5  \n"-i":  1  3  6 10 15 \n"-o":  1  4 10 20 35 \n"-u":  1  5 15 35 70 \n------------------------\nsum :  5 15 35 70 126\n```\nWe can see that this is a pascal triangle but it is oblique. Or we can see below:\n\n![image](https://assets.leetcode.com/users/images/390a1089-d152-43e9-8ce4-4a0c3419f38f_1604204596.6583333.png)\n\nTherefore, the sum of all strings at n is located at the **n+2th** element of **n+6th** row.\n\nAccording to Pascal Triangle: kth element at nth row is c(n-1, k-1)\n\n**Code:**\n```\nclass Solution:\n    def countVowelStrings(self, n: int) -> int:\n        return math.comb(n+4, n)\n```\n\n\n\n\n
[]