Sliding Window | c++
\n\t\tint i = 0;\n        int j = 0;\n        int cnt = 0;\n        unordered_map<int,int> mp;\n        while(j < s.length()){\n            mp[s[j]]++;\n       
```\n\t\tint i = 0;\n        int j = 0;\n        int cnt = 0;\n        unordered_map<int,int> mp;\n        while(j < s.length()){\n            mp[s[j]]++;\n            if(mp.size() == 3){\n                while(mp.size() == 3){\n                    cnt += s.length()-j;\n                    mp[s[i]]--;\n                    if(mp[s[i]] == 0){\n                        mp.erase(s[i]);\n                    }\n                    i++;\n                }\n            }\n            j++;\n            \n        }\n        return cnt;\n\t```
['C++']