[Java] Simple Solution with Approach
Consider an string - axexixoxu\n\n\n\n\n\n\nclass Solution {\n    public long countVowels(String word) {\n        \n        char[] arr = word.toCharArray();\n  
Consider an string - axexixoxu\n![image](https://assets.leetcode.com/users/images/2e04aacb-7e0c-4d80-b3d6-bcb7416abe78_1640933350.0802453.png)\n\n\n\n```\n\nclass Solution {\n    public long countVowels(String word) {\n        \n        char[] arr = word.toCharArray();\n        int n = arr.length;\n        \n        long result = 0L;\n        for(int i=0; i<n; i++){\n            if(isVowel(arr[i])){\n                result = result + (n-i)*(i+1L);\n            }\n        }\n        \n    \n        return result;\n    }\n    \n    public boolean isVowel(char c){\n        return (c == \'a\' || c == \'e\' || c == \'i\' || c == \'o\' || c == \'u\');\n    }\n}\n```
[]