Simple c++ solution | Sliding Window | Hashmap | Explained clearly with comments
\n\n string minWindow(string s, string t) {\n        // Initialize minl as INT_MAX\n        int minl = INT_MAX;\n        \n        // Map to keep count of all c
\n```\n string minWindow(string s, string t) {\n        // Initialize minl as INT_MAX\n        int minl = INT_MAX;\n        \n        // Map to keep count of all characters of t \n        unordered_map <int, int> mp;\n        for(auto ch: t) mp[ch]++;\n        \n        // Sliding Window Approach\n        // Let c be the count of chars of t in a particular window. Initialize as 0\n        // start be the start of the current window\n        // end be the end of current window\n        // minstart be the start for the minimum window found yet.\n        \n        int c = 0;\n        \n        int start = 0;\n        int minstart = 0;\n        \n        for(int end = 0; end<s.length(); end++)\n        {\n            if(mp[s[end]]>0) c++;\n            mp[s[end]]--; \n            \n            // continue untill c equals length of t or when current window has all characters of t in it\n            if(c==t.length())\n            {\n                // Note that negative values in map indicate the key char is not present in t, but present in s. And hence leading chars in s with negative values are insignificant.\n                \n                while(start<end && mp[s[start]]<0){\n                    mp[s[start]]++;\n                    start++;\n                }\n                \n                if(end-start+1<minl)\n                {\n                    minl = end-start+1;\n                    minstart = start;\n                }\n                \n                // reduce the window size by incrementing start, reducing mp[s[start]] value, and reducing c\n    \n                mp[s[start]]++;\n                start++;\n                c--;\n            }\n        }\n        \n        if(minl==INT_MAX) return "";\n        return s.substr(minstart, minl);\n```
['Two Pointers', 'C', 'Sliding Window']