Given an array of integers positions representing the locations of devices in a Hardware-in-the-Loop (HWIL) testing setup, and an integer k representing the number of devices to place, your task is to minimize the maximum distance between the furthest pair of placed devices.
You can place k devices in the given positions, and the goal is to find the smallest possible maximum distance between the devices.
Example 1:
Input: positions = [1, 2, 8, 4, 9], k = 3
Output: 3
Explanation: Place devices at positions 1, 4, and 8. The maximum distance is 4 - 1 = 3.
Example 2:
Input: positions = [1, 3, 6, 8, 10], k = 2
Output: 4
Explanation: Place devices at positions 1 and 6. The maximum distance is 6 - 1 = 5.
1 <= positions.length <= 10^51 <= positions[i] <= 10^91 <= k <= positions.length