Minimum window substring
Hardsliding windowhash mapstring
Return the shortest contiguous part of s that contains every character of t (with repeats). If several tie, return the leftmost. If none exists, return an empty string.
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: ""
Constraints
- 1 ≤ s.length, t.length ≤ 10⁵
- English letters
Submit checks your solution against 8 tests, including hidden ones.
/**
* @param {string} s
* @param {string} t
* @return {string}
*/
function minWindow(s, t) {
}