Minimum Window Substring — C# Coding Problem
Difficulty: hard | Category: sliding-window
Problem Description
Given two strings `s` and `t` of lengths `m` and `n`, return the **minimum window substring** of `s` such that every character in `t` (including duplicates) is included in the window. If no such substring exists, return an empty string. Input format: `s|t` **Constraints:** - `m == s.length`, `n == t.length` - `1 <= m, n <= 10⁵` - `s` and `t` consist of uppercase and lowercase English letters. **Hint:** Sliding window — expand right until all characters are covered, then shrink from left.
Examples
Example 1
Input: s = "ADOBECODEBANC", t = "ABC"
Output: "BANC"
Example 2
Input: s = "a", t = "a"
Output: "a"
Example 3
Input: s = "a", t = "aa"
Output: ""
Explanation: t needs two a's but s has only one.