2063. Vowels of All Substrings Updated: 2024-03-12 1 min read Algorithms , LeetCode On This PageLeetCode problem 2063class Solution: def countVowels(self, word: str) -> int: n = len(word) return sum((i + 1) * (n - i) for i, c in enumerate(word) if c in 'aeiou')