Skip to content

Latest commit

 

History

History
4 lines (3 loc) · 306 Bytes

File metadata and controls

4 lines (3 loc) · 306 Bytes

Find K Closest Elements

Try the problem

Given a sorted array, two integers k and x, find the k closest elements to x in the array. The result should also be sorted in ascending order. If there is a tie, the smaller elements are always preferred.