16ms simple and neat c++ solution only using a vector. Detailed explanation
Initialize a vector called remaining, which contains the needed\n    matching numbers of each character in s. \n 2. If there are still\n        characters neede
 1. Initialize a vector called `remaining`, which contains the needed\n    matching numbers of each character in `s`. \n 2. If there are still\n        characters needed to be contained (increment `i` in this case),\n        decrease the matching number of that character and check if it is\n        still non-negative. If it is, then it is the character in `t`, so\n        decrease the total required number `required`.  \n 3. If there is no more\n            characters required (increment `start` in this case),  record `min`\n            and `left` if a smaller length is found. Recover the number of this\n            character in the `remaining` and if it is a character in `t`\n            increase `required`.\n\n\n----------\n\n    class Solution {\n    public:\n        string minWindow(string s, string t) {\n            if (s.size() == 0 || t.size() == 0) return "";\n            vector<int> remaining(128, 0);\n            int required = t.size();\n            for (int i = 0; i < required; i++) remaining[t[i]]++;\n            // left is the start index of the min-length substring ever found\n            int min = INT_MAX, start = 0, left = 0, i = 0;\n            while(i <= s.size() && start < s.size()) {\n                if(required) {\n                    if (i == s.size()) break;\n                    remaining[s[i]]--;\n                    if (remaining[s[i]] >= 0) required--;\n                    i++;\n                } else {\n                    if (i - start < min) {\n                        min = i -start;\n                        left = start;\n                    }\n                    remaining[s[start]]++;\n                    if (remaining[s[start]] > 0) required++;\n                    start++;\n                }\n            }\n            return min == INT_MAX? "" : s.substr(left, min);\n        }\n    };
[]