Find K Closest Elements
Pick a window of k numbers from a sorted list that sits nearest a target. The visual slides two pointers inward, dropping whichever end is farther away.
Pick a window of k numbers from a sorted list that sits nearest a target. The visual slides two pointers inward, dropping whichever end is farther away.