Return the shortest substring of s that contains every character of t (with multiplicity). If there are several, return the leftmost. Return "" if none.
Signature
minWindow(s: string, t: string) → stringExample 1
s = "ADOBECODEBANC"
t = "ABC"
output = "BANC"
'BANC'
Example 2
s = "a"
t = "aa"
output = ""
not enough a's → ''
Constraints
1 ≤ |s|, |t| ≤ 10^5
⌘/Ctrl + Enter runs examples
Run checks the examples. Submit runs every hidden test (17, including large inputs that catch slow solutions).