Easy C++ solution using Only 2 variables | Linear Time | Constant Space
Use two variables a and b.\n For each index i , variable a represents the no of vowels in all the substrings ending at (i-2)th index and variable b represents t
* Use two variables a and b.\n* For each index `i` , variable `a` represents the no of vowels in all the substrings ending at `(i-2)th` index and variable `b` represents the no. of vowels in all the substrings ending at `(i-1)th` index.\n* Using `a` and `b` compute the no of vowels in all the substrings ending at `(i-1)th`**(new a)** index and  `ith` index **(new b)**. \n```\nclass Solution {\npublic:\n    long long countVowels(string word) {\n        \n        long long int a = 0,b = 0;\n        int n = word.length();\n        for(int i = 0; i < n; i++){\n            \n            auto x = word[i];\n            \n            a = a + b;\n            \n            b = b + ((x==\'a\' || x==\'e\' || x==\'i\' || x==\'o\' || x==\'u\') ? (i+1) : 0);\n            \n        }\n        \n        return a + b;\n        \n    }\n};\n```
['C']