Two Pointer
Everything on SkillVeris tagged Two Pointer — collected across the glossary, study notes, blog, and cheat sheets.
4 resources across 1 library
Interview Questions(4)
How Do You Find the Number of Subarrays That Sum to K?
You solve subarray-sum-equals-k in O(n) time by tracking a running prefix sum and a hash map of how many times each prefix sum value has occurred so far, since…
How Do You Find the Maximum in Every Sliding Window of Size K?
You solve sliding-window-maximum in O(n) time using a monotonic deque that stores indices in decreasing order of their values, so the front of the deque is alw…
What is the Monotonic Queue Technique?
A monotonic queue is a deque that keeps its elements in strictly increasing or decreasing order by evicting from the back any element that can never again be t…
How Do You Solve the Meeting Rooms Problem?
The meeting rooms problem asks for the minimum number of rooms needed to host a set of meetings, and it is solved by separating start and end times into two so…