2063. Vowels of All Substrings

Обновлено: 2024-03-12
1 мин
[]

Содержание

LeetCode problem 2063

class 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')