C++|| O(n) || explained
Idea: The idea is to use a prefix sum array-based technique where we store the occurrences of each character in all the substrings concatenated. \n\nclass Solut
Idea: The idea is to use a prefix sum array-based technique where we store the occurrences of each character in all the substrings concatenated. \n```\nclass Solution {\npublic:\n    long long countVowels(string s) {\n        long long n = s.length();\n        vector<long long> v;\n\n        for (long long i = 0; i < n; i++) {\n            // No. of occurrences of 0th character\n            // in all the substrings\n            if (i == 0)\n                v.push_back(n);\n            else\n                // No. of occurrences of the ith character\n            // in all the substrings\n\t\t\t//For each of the following characters, we store the no. of substrings starting with that character + the number of //substrings formed by the previous characters containing this character \u2013 the number of substrings formed by the previous //characters only.\n                v.push_back((n - i) + v[i - 1] - i);\n        }\n\n        long long sum = 0;\n        for (int i = 0; i < n; i++)\n            if (s[i] == \'a\' || s[i] == \'e\' || s[i] == \'i\'\n                || s[i] == \'o\' || s[i] == \'u\')\n                sum += v[i];\n    // Return the total sum\n        // of occurrences of vowels\n        return sum;\n    }\n};\n```
['C', 'C++']