How does the two-pointer technique work?
Uses two indices to optimize searching.
What are common two-pointer use cases?
Sorted Two Sum, Reverse String.
What is Sliding Window?
Shrinks and expands a window for optimization.
What is the difference between fixed and variable sliding windows?
Fixed has a set size; variable expands/contracts.
How do we keep sliding window O(n)?
The left and right pointers should only traverse the array once.
What operations happen in a variable size sliding window?
Each element is processed twice: once when expanding, once when contracting.
What operations happen in a fixed-size sliding window?
Each element is added to the window once and removed once.