Minimum window substring
\n\nusing System;\nusing System.Collections.Generic;\n\npublic class Solution\n{\n    public string MinWindow(string s, string t)\n    {\n        if (s.Length =
\n```\nusing System;\nusing System.Collections.Generic;\n\npublic class Solution\n{\n    public string MinWindow(string s, string t)\n    {\n        if (s.Length == 0 || t.Length == 0)\n            return "";\n\n        var required = new Dictionary<char, int>();\n        var window = new Dictionary<char, int>();\n        \n        foreach (char c in t)\n        {\n            if (required.ContainsKey(c))\n                required[c]++;\n            else\n                required[c] = 1;\n        }\n\n        int left = 0;\n        int right = 0;\n        int minLength = int.MaxValue;\n        int start = 0;\n        int requiredChars = required.Count;\n        int formedChars = 0;\n\n        while (right < s.Length)\n        {\n            char c = s[right];\n            window[c] = window.GetValueOrDefault(c, 0) + 1;\n\n            if (required.ContainsKey(c) && window[c] == required[c])\n                formedChars++;\n\n            while (left <= right && formedChars == requiredChars)\n            {\n                if (right - left + 1 < minLength)\n                {\n                    minLength = right - left + 1;\n                    start = left;\n                }\n\n                char leftChar = s[left];\n                window[leftChar]--;\n                if (required.ContainsKey(leftChar) && window[leftChar] < required[leftChar])\n                    formedChars--;\n\n                left++;\n            }\n\n            right++;\n        }\n\n        return minLength == int.MaxValue ? "" : s.Substring(start, minLength);\n    }\n}\n\n```
['C#']