Python DP
Intuition\n Describe your first thoughts on how to solve this problem. \n$dp[i]$: the sum of the number of vowels in every substrings ending at index $i$.\n\n# 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n$dp[i]$: the sum of the number of vowels in every substrings ending at index $i$.\n\n# Code\n```\nclass Solution:\n    def countVowels(self, word: str) -> int:\n        n = len(word)\n        dp = [0] * n\n        dp[0] = word[0] in \'aeiou\'\n        for i in range(1, n):\n            if word[i] in \'aeiou\':\n                # 1: the single element substring \'word[i]\' has one vowel\n                # dp[i - 1] + 1\uFF1Aevery substrings ending at index i - 1 can be extended to index i, and get 1 more number of vowels. Totally there are i substrings ending at index i - 1.\n                dp[i] = 1 + dp[i - 1] + i\n            else:\n                dp[i] = dp[i - 1]\n        return sum(dp)\n```
['Dynamic Programming', 'Python3']