⭐✅ LOGICAL COMMENTS || EASY C++ CODE || Including logical comments
Easy to understand code with complete comments:\n\n\nclass Solution {\npublic:\n    string minWindow(string s, string t) {\n        unordered_map<char, int>mp;\
# Easy to understand code with complete comments:\n\n```\nclass Solution {\npublic:\n    string minWindow(string s, string t) {\n        unordered_map<char, int>mp;\n        \n        // keeping track of common char b/w s ans t\n        for(auto i : t)\n            mp[i]++;\n        \n        int start = 0,end =0;   // starting and ending of window\n        int minlen = INT_MAX, minstart = 0;\n        int count = t.size();   // variable to track when our window becomes valid\n        int s_size = s.size();\n        \n        while(end<s_size)\n        {\n            \n            if(mp[s[end]]>0)    // possible only for char common b/w s and t\n                count--;\n            \n            mp[s[end]]--; // adding char to window and decreasing the mapping\n            end++;          //move end forward\n            \n            while(count==0) // possible answer only here\n            {\n                if(end - start < minlen)  // window length minimization\n                {\n                    minlen = end - start;\n                    minstart = start;\n                }\n                \n                mp[s[start]]++; // removing char from window and increasing the mapping\n                \n                if(mp[s[start]]>0)  // possible only for the common chars and hence increase its count to make window invalid\n                    count++;\n                \n                start++;    // move start forward\n            }\n            \n        }\n        \n        if (minlen != INT_MAX)\n\t\t    return s.substr(minstart, minlen);\n\t    return "";  // happens when s.size() < t.size()\n    }\n};\n```
['Two Pointers', 'C', 'Sliding Window', 'C++']