Mental Model
Find the smallest part of a string that contains all characters of another string. We slide a window over the string, expanding and shrinking it to find the minimum size that fits all needed characters.
Analogy: Imagine you have a long shelf of books and a list of books you need. You want to find the shortest segment of the shelf that contains all the books on your list, moving your hands to grab and release books until you find the smallest group that works.
s: A B C D E F G H I J K L M N O P
window: [↑ -> ]
need: {A:1, B:1, C:1}
have: {A:1, B:0, C:1}
The window moves right to include needed letters and left to shrink when all are included.