Pattern Recognition Drill
Hard Sliding Window
The Problem
Given strings s and t, find the minimum window in s that contains all characters of t.
What approach would you use?
Think about it before scrolling down.
Expand right to include chars; shrink left while all t chars are covered. Track best window. O(n).
Two frequency maps (need vs have) with a count of satisfied characters. O(n).
Common Trap
Handle duplicate characters in t correctly — 'have' count must match 'need' count per character.