python: dynamic programming
start from the last position. that will be our base case. then count and store number of vowels.\n\n\nclass Solution:\n    def countVowels(self, word: str) -> i
start from the last position. that will be our base case. then count and store number of vowels.\n\n```\nclass Solution:\n    def countVowels(self, word: str) -> int:\n        # count and store number of vowels\n        dp = [0] * (len(word)+1)\n        for i in range(len(word)-1, -1, -1):\n            if word[i] in "aeiou":\n                dp[i] = dp[i+1] + len(word)-i\n            else:\n                dp[i] = dp[i+1]\n        return sum(dp)\n```
[]