You are given a sorted array stations[] representing the positions of existing gas stations on a number line, and an integer k representing the number of additional gas stations you can add. Your task is to add exactly k new gas stations anywhere on the number line such that the maximum distance between any two adjacent gas stations is minimized. Return the minimized maximum distance.
Topics
Companies
Articles
Examples:
N/A
Constraints:
2 = stations.length = 105
0 = stations[i] = 10?
0 = k = 105
stations is sorted in ascending order
Companies:
Apple
Topics:
Binary Search
Please log in to access the Submissions tab, where you can review your progress and explore code submissions from other participants.
Please log in to access the Solution tab and view detailed answers and explanations.
Please log in to access the Discussion tab and join conversations with other participants.
Access Restricted: Please Login to access the code editor and test cases.