Most people learn sliding window and two pointers as two separate techniques, practice them in isolation, and then freeze when a new array problem appears because they can't tell which one applies. The problem isn't that the techniques are hard. The problem is that nobody teaches the decision — the moment before you write code where you look at the problem and know, without guessing, which pattern fits. This guide fixes that. What sliding window actually solves Sliding window is for problems where you need to find or optimize a contiguous subarray or substring that satisfies some condition. The word contiguous is the key. You're not picking elements from anywhere in the array — you need a connected segment. The window metaphor is accurate: you have a left and right boundary, and you move them to expand or shrink a range while tracking something inside it (a sum, a character count, a frequency map).…