Given an integer array arr and two integers k and x. Your task is to find k numbers from the array that are nearest to the value x. The nearness of a integer is determined by its absolute difference from x. If two integers have the same difference from x, choose the smaller integer. Return the selected integers sorted in ascending order.
Your notes are automatically saved in your browser's local storage and will persist across sessions on this device.