Two pointers
Also written: two pointer
Keeping two indexes, `left` at the front and `right` at the back of a sorted list, and moving one inward each step. It finds pairs in O(n) time and O(1) space.
Also written: two pointer
Keeping two indexes, `left` at the front and `right` at the back of a sorted list, and moving one inward each step. It finds pairs in O(n) time and O(1) space.