A technique for solving array and string problems in O(n) time with two scanning indices.
The two pointers technique — a simple pattern that solves a surprising number of array and string problems in linear time.