simple maths
\n# Approach\njust check, in  how many substrings that vowel is appears.\n\n# Complexity\n- Time complexity:\nO(n)\n\n- Space complexity:\nO(1)\n\n\n# Code\n\nc
\n# Approach\njust check, in  how many substrings that vowel is appears.\n\n# Complexity\n- Time complexity:\nO(n)\n\n- Space complexity:\nO(1)\n![IMG_20230903_030517.jpg](https://assets.leetcode.com/users/images/e721f39c-dfdb-4ee6-9d03-ba5d641c5a30_1693690572.556952.jpeg)\n\n# Code\n```\nclass Solution {\npublic:\n    long long countVowels(string s) {\n        //(i+1)*(n-i)\n        long long ans = 0, n = s.length();\n        for(long long i = 0; i < s.length(); i++){\n            if(s[i]==\'a\'||s[i]==\'e\'||s[i]==\'i\'||s[i]==\'o\'||s[i]==\'u\'){\n                ans = ans + (i+1)*(n-i);\n            }\n        }\n        return ans;\n    }\n};\n```
['C++']