Minimum Window Substring
hardFind the smallest substring that contains all characters of another string
Minimum Window Substring
Key Insight
Expand right until all target characters covered, then shrink left to minimize
Step 1Target Characters
Need: A:1, B:1, C:1
A
0D
1O
2B
3E
4C
5O
6D
7E
8B
9A
10N
11C
12Identify which characters we need to cover from string t.
1 / 6