Clean Python3, sliding window
Maintain a window which contains at least each character of a, b and c.\nOnce we found a window, rest part of that window will be a valid count.\nSo we can add 
Maintain a window which contains at least each character of a, b and c.\nOnce we found a window, rest part of that window will be a valid count.\nSo we can add `len(s) - i` on it.\n\n```\nimport collections\nclass Solution:\n    def numberOfSubstrings(self, s: str) -> int:\n        j, result, counter = 0, 0, collections.Counter()\n        for i, c in enumerate(s):\n            counter[c] += 1\n            while len(counter) == 3:\n                result += len(s) - i\n                counter[s[j]] -= 1\n                if not counter[s[j]]: del counter[s[j]]\n                j += 1\n        return result\n```
[]