Sliding Window
For finding subarrays/substrings with a specific criteria.
- Use Two pointers:
start
andend
to represent a window - Move
end
to find a valid window - When a valid window is found, move
start
to find a smaller(better) window.
For finding subarrays/substrings with a specific criteria.
start
and end
to represent a windowend
to find a valid windowstart
to find a smaller(better) window.