:: Kotlin :: Sliding Window
\n# Code\n\nclass Solution {\n    fun countVowels(word: String): Long {\n        val vowels = arrayOf(\'a\',\'e\',\'i\',\'o\',\'u\').toSet()\n        var result
\n# Code\n```\nclass Solution {\n    fun countVowels(word: String): Long {\n        val vowels = arrayOf(\'a\',\'e\',\'i\',\'o\',\'u\').toSet()\n        var result = 0L\n        var accs = 0L\n\n        for (i in 0 until word.length) {\n            if (vowels.contains(word[i])) {\n                accs = accs + i + 1\n            }\n            result += accs\n        }\n\n        return result\n    }\n}\n```
['Kotlin']