Greedy approch
Intuitionfind the code as the approchApproachIts simple maths.Complexity

Time complexity: O(n)


Space complexity: O(n)

Code
# Intuition
find the code as the approch
# Approach
Its simple maths.
# Complexity
- Time complexity: $$O(n)$$

- Space complexity: $$O(n)$$

# Code
```cpp []
class Solution {
public:
    long long countVowels(string words) {
        long long ans=0;
        for(int i=0;i<words.size();i++){
            if(words[i]=='a' || words[i]=='e' || words[i]=='i' || words[i]=='o' || words[i]=='u'){
                ans+=(i+1)*(words.size()-i);
            }
        }
        return ans;
    }
};
```
['Math', 'String', 'C++']