[Leetcode] Find K Closest Elements
A rarely seen pattern of two pointers.
Description
Given a sorted integer array arr
, two integers k
and x
, return the k
closest integers to x
in the array. The result should also be sorted in ascending order.