1Decide upfront: fixed-size window or variable-size? Fixed = move left with right. Variable = shrink left only on violation.
2Maintain a hash map of character/element frequencies inside the window to track constraints in O(1).
3Update the answer AFTER adjusting the window to a valid state — never record an invalid window.
4For "minimum window" problems, shrink as much as possible before recording the answer.