C++ || Easy to understand
\nclass Solution {\npublic:\n    long long countVowels(string word) {\n        long long ans = 0;\n        for(int i=0; i<word.size(); i++){\n            long l
```\nclass Solution {\npublic:\n    long long countVowels(string word) {\n        long long ans = 0;\n        for(int i=0; i<word.size(); i++){\n            long long c = 0;\n            if(word[i] == \'a\' or word[i] == \'e\' or word[i] == \'i\' or word[i] == \'o\' or word[i] == \'u\'){\n               \n                if(i == 0 or i == word.size()-1){\n                     c = word.size();\n                }\n                else{\n                     c = word.size();\n                    long long a = i*(word.size()-i-1);\n                    c += a;\n                }\n            }\n            ans += c;\n        }\n        return ans;\n    }\n};\n```
[]