C++||Very Short Solution|| One optimized solution but still TLE||
\t//Use of Little Math\n\tclass Solution {\n\tpublic:\n    long long countVowels(string word) {\n        double count=0;\n        double n=word.size();\n       
\t//Use of Little Math\n\tclass Solution {\n\tpublic:\n    long long countVowels(string word) {\n        double count=0;\n        double n=word.size();\n        for(double i=0;i<n;++i){\n            if(word[i]==\'a\' || word[i]==\'e\'||word[i]==\'i\'||word[i]==\'o\'||word[i]==\'u\')\n                count+=((i+1)*(n-i));\n        }\n        return count;\n\t\t}\n\t};\n\t\n\t//Optimized Solution But still got TLE\n\t\n\tclass Solution {\n\tpublic:\n    long long countVowels(string word) {\n         unordered_map<char,int> m1;\n        m1[\'a\']=1;\n        m1[\'e\']=1;\n        m1[\'i\']=1;\n        m1[\'o\']=1;\n        m1[\'u\']=1; \n                //count//lastIndex\n        vector<pair<int,int>> v;\n        double ans=0;\n        for(int i=0;i<word.size();++i){\n            int len=v.size();\n            vector<pair<int,int>> temp;\n            for(int j=0;j<len;++j){\n                //if(v[j].second==i-1){\n                    if(m1.find(word[i])!=m1.end()){\n                        int count=v[j].first+1;\n                        int lastIndex=i;\n                        ans+=count;\n                        temp.push_back({count,lastIndex});\n                    } else{\n                        int count=v[j].first;\n                        int lastIndex=i;\n                        ans+=count;\n                        temp.push_back({count,lastIndex});\n                    }\n            }\n            if(m1.find(word[i])!=m1.end()){\n                temp.push_back({1,i});\n                ans++;\n            }\n            else temp.push_back({0,i});\n            v=temp;\n        }\n        return ans;\n    }\n\t};
[]