76. Minimum Window Substring
Practice Minimum Window Substring for free on NudgeCode: Hard, Sliding Window pattern. Write it in Python or JavaScript, run the tests in your browser, and ask for a hint when you are stuck.
Return the shortest contiguous piece of s that contains every character of t, counting repeats (if t has two as, the piece needs at least two as). If no such piece exists, return "". The tests are built so the shortest piece is unique.
Example
s = "ADOBECODEBANC", t = "ABC" -> "BANC"
s = "a", t = "aa" -> ""
Constraints
- 1 <= s.length, t.length <= 10^5
sandtcontain uppercase and lowercase English letters- Aim for O(s.length + t.length) time