[Python 3] two prefix sums
```\nclass Solution:\n    def countVowels(self, word: str) -> int:\n        n = len(word)\n        \n        # mark vowel\n        # \'aba\' vowels = [1, 0, 1]\
```\nclass Solution:\n    def countVowels(self, word: str) -> int:\n        n = len(word)\n        \n        # mark vowel\n        # \'aba\' vowels = [1, 0, 1]\n        vowels = list(map(lambda x: int(x in \'aeiou\'), word))\n        \n        # add vowel count in each substring\n        # acc = [0, 1, 1, 2]\n        acc = list(accumulate(vowels, initial=0))\n        \n        # add up vowel count\n        # acc2 = [0, 1, 2, 4]\n        acc2 = list(accumulate(acc))\n\n        \n        ans = 0\n        for i in range(n+1):\n            # add up accumulative vowel count in substring start from index i\n            ans += acc2[-1] - acc2[i]\n            # subtract previous vowel counts from current substrings\n            if i > 0:\n                ans -= (acc[i-1]) * (len(acc2) - i)\n        \n        return ans
['Prefix Sum', 'Python', 'Python3']