Simple Sliding Window | C++
\nint numberOfSubstrings(string s) {\n        vector<int> mp(3, 0);\n        int i = 0, j = 0, counter = 0, ans = 0;\n        while(j < s.size()) {\n           
```\nint numberOfSubstrings(string s) {\n        vector<int> mp(3, 0);\n        int i = 0, j = 0, counter = 0, ans = 0;\n        while(j < s.size()) {\n            if(mp[s[j++] - \'a\']++ == 0) counter++;\n            while(counter == 3) {\n                ans++;\n                ans += (s.size() - j);\n                if(mp[s[i++] - \'a\']-- == 1) counter--;\n            }\n        }\n        return ans;\n    }\n```
[]