1class Solution {2public:3bool isVowel(char ch) {4return ch == 'a' or ch == 'e' or ch == 'i' or ch == 'o' or ch == 'u';5}67long long countVowels(string word) {8long long count = 0;9int len = word.size();1011for (int pos = 0; pos < len; pos++) {12if (isVowel(word[pos])) {13count += (long)(len - pos) * (long)(pos + 1);14}15}1617return count;18}19};