Fastest Python Solution | 108ms
Fastest Python Solution | 108ms\nRuntime: 108 ms, faster than 100.00% of Python3 online submissions for Vowels of All Substrings.\nMemory Usage: 14.8 MB, less t
# Fastest Python Solution | 108ms\n**Runtime: 108 ms, faster than 100.00% of Python3 online submissions for Vowels of All Substrings.\nMemory Usage: 14.8 MB, less than 100.00% of Python3 online submissions for Vowels of All Substrings.**\n```\nclass Solution:\n    def countVowels(self, word: str) -> int:\n        c, l = 0, len(word)\n        d = {\'a\':1, \'e\':1,\'i\':1,\'o\':1,\'u\':1}\n        \n        for i in range(l):\n                if word[i] in d:\n                    c += (l-i)*(i+1)\n        return c\n```\n![image](https://assets.leetcode.com/users/images/697a073a-9322-4b45-a737-10da70505d33_1636264423.3988705.png)\n\n
['Python', 'Python3']