c++||o(n) solution
```\n int n= w.length();\n      bool v[26] = {1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0};\n       long long ans=0;\n        f
```\n int n= w.length();\n      bool v[26] = {1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0};\n       long long ans=0;\n        for(int i=0;i<n;i++){\n            //char ch=word[i];\n            long long res1=(i+1);\n            long long res2=(n-i);\n          ans+=v[w[i]-\'a\']*res1*res2;\n        }\n        return ans;
[]