Minimum Window Substring (Hard Variant) — C# Coding Problem
Difficulty: hard | Category: sliding-window
Problem Description
Given two strings `s` and `t` of lengths `m` and `n` respectively, return the **minimum window substring** of `s` such that every character in `t` (including duplicates) is included in the window. If there is no such substring, return the empty string. The test cases will be generated such that the answer is **unique**. **Approach:** Sliding window with two frequency maps. Expand right pointer; when all chars covered, shrink from left. **(This is a harder variant — the input strings are longer and require an optimised approach.)**
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: ""