12 lines Python
The current window is s[i:j] and the result window is s[I:J]. In need[c] I store how many times I need character c (can be negative) and missing tells how many 
The current window is `s[i:j]` and the result window is `s[I:J]`. In `need[c]` I store how many times I need character `c` (can be negative) and `missing` tells how many characters are still missing. In the loop, first add the new character to the window. Then, if nothing is missing, remove as much as possible from the window start and then update the result.\n\n    def minWindow(self, s, t):\n        need, missing = collections.Counter(t), len(t)\n        i = I = J = 0\n        for j, c in enumerate(s, 1):\n            missing -= need[c] > 0\n            need[c] -= 1\n            if not missing:\n                while i < j and need[s[i]] < 0:\n                    need[s[i]] += 1\n                    i += 1\n                if not J or j - i <= J - I:\n                    I, J = i, j\n        return s[I:J]
['Python']