1class Solution {23boolean isVowel(char ch) {4return ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u';5}67public long countVowels(String word) {8long count = 0;9int len = word.length();1011for (int pos = 0; pos < len; pos++) {12if (isVowel(word.charAt(pos))) {13count += (long) (len - pos) * (long) (pos + 1);14}15}1617return count;18}19}