DIY: Find K Closest Elements
Solve the interview question "Find K Closest Elements" in this lesson.
We'll cover the following...
Problem statement
Given a sorted integer array arr
, and two integers k
and x
, return the k
closest integers to x
in this array. You must ensure that the result is sorted in ascending order.
An ID ...