You are an optimization strategist tasked with making the smartest choices from constrained ranges. Given an array of starting positions start and a range distance d, you have n intervals where the i-th interval is [start[i], start[i] + d].
Your mission: Choose exactly one integer from each interval such that the minimum absolute difference between any two chosen numbers is as large as possible. This minimum difference is your "score" - and you want to maximize it!
Think of it as: You're placing guards at strategic positions within their assigned zones, and you want to ensure the closest two guards are as far apart as possible for maximum coverage.
Example: If start = [1, 0, 9] and d = 2, your intervals are [1,3], [0,2], [9,11]. You might choose 2, 0, 10 giving you differences of |2-0|=2, |10-2|=8, |10-0|=10. The minimum is 2, which becomes your score.
Input & Output
Constraints
- 1 โค start.length โค 104
- 0 โค start[i] โค 108
- 0 โค d โค 104
- All intervals have the same length d