Place K servers in data centers to maximize the minimum distance between them.
Unlock detailed company stats for this questionUpgrade
An investment bank operates N data centers connected along a high-speed fiber network. The position of each data center is its distance in kilometers from the bank's primary exchange. The bank wants to deploy exactly K order-routing servers in these data centers, placed as far apart as possible to improve fault tolerance and reduce the impact of localized network failures.
Given an integer array positions, where positions[i] is the location of the ith data center, and an integer K, return the largest possible minimum distance between any two deployed servers.
Example: positions = [1, 2, 4, 8, 9]; K = 3 gives 3.
Format · Technical interview.
Community answers
No answers contributed by the community yet.


