[Python] One liner O(N)
\n\nclass Solution:\n    def countVowels(self, word: str) -> int:\n        return sum((i+1)*(len(word)-i) for i in range(len(word)) if word[i] in "aeiou")\n\n\n
\n```\nclass Solution:\n    def countVowels(self, word: str) -> int:\n        return sum((i+1)*(len(word)-i) for i in range(len(word)) if word[i] in "aeiou")\n\n\n\n        \n\n\n        \n```
['Python3']