Minimum Window Substring

00:00
HardStringSliding WindowHashMap
FacebookGoogle

Find the minimum window substring of s that contains all characters of t (including duplicates).

Examples

Input → s='ADOBECODEBANC', t='ABC'
Output → 'BANC'
Input → s='a', t='a'
Output → 'a'
Input → s='a', t='aa'
Output → ''
Note: not enough 'a's