Sliding window applies when:
Contiguous elements: Answer involves subarray/substring.
Incremental updates: Add/remove has simple effect.
Monotonic constraint: Shrinking left maintains/restores validity.
Keywords: "subarray", "substring", "consecutive", "max/min length", "at most K".
Does NOT apply: Non-contiguous (subsequences), removing left can worsen things, need all windows (use DP).