[Accepted] Swift
\nclass Solution {\n    func countVowels(_ word: String) -> Int {\n\n        let chs = Array(word)\n        var res = 0\n\n        for i in chs.indices\n       
```\nclass Solution {\n    func countVowels(_ word: String) -> Int {\n\n        let chs = Array(word)\n        var res = 0\n\n        for i in chs.indices\n            where "aeiou".contains(chs[i]) {\n                res += (chs.count - i) * (i + 1)\n            }\n\n        return res\n    }\n}\n```
['Swift']