🙎C++ || Easy || Daily LeetCoding Challenge (22nd October 2022)
Easy to Understand\nIf understand the sol^n then Please Upvote\n\nclass Solution {\npublic:\n    string minWindow(string s, string t) {\n        if (s.size() < 
# Easy to Understand\n**If understand the sol^n then Please Upvote**\n```\nclass Solution {\npublic:\n    string minWindow(string s, string t) {\n        if (s.size() < t.size() or s.empty()) {\n            return "";\n        }\n        \n        int i = 0, j = 0;\n        int start = -1, len = INT_MAX;\n        std::vector<int> m(128, 0);\n        \n        // Push elements of t into hash table.\n        for (auto c : t) {\n            m[c]++;\n        }\n        \n        while (j < s.size()) {\n            if (isFound(m)) {\n                // Current string contains all characters of t,\n                // then we start to shrink it from left.\n                if (j - i < len) {\n                    start = i;\n                    len = j - i;\n                }\n                m[s[i++]]++;\n                continue;\n            }\n            // Current string doesn\'t contain all characters of t,\n            // so we need to extend it and do checking in the next iteration.\n            m[s[j++]]--;\n        }\n        \n        // Try to shrink the last found string.\n        while (isFound(m)) {\n            if (j - i < len) {\n                start = i;\n                len = j - i;\n            }\n            m[s[i++]]++;\n        }\n        \n        if (start != -1) {\n            return s.substr(start, len);\n        }\n        return "";\n    }\n\nprivate:\n    // If all values of hash table are <= 0,\n    // it means all characters of t are included in current string\n    bool isFound(const std::vector<int>& m) {\n        return std::all_of(m.begin(), m.end(), [](int i) { return i <= 0; });\n    }\n};\n```\n\n
['Hash Table', 'C', 'Sliding Window']