Problem intuition
- The brute-force version tries every possible substring and checks whether it covers the target counts.
- The optimal solution grows the window until all requirements are met, then shrinks from the left to make the valid window as small as possible.