As reported: D. E. Shaw MTS onsite round 2 (Oct 2024): a DSA question named "Maximize Score of Numbers in Ranges", followed by a string question and CS fundamentals.
This is LeetCode 3281 — Maximize Score of Numbers in Ranges. Our write-up: /maximize-score-of-numbers-in-ranges.
You are given an integer array start and an integer d, describing n intervals [start[i], start[i] + d]. Choose n integers, the i-th from the i-th interval. The score of a choice is the minimum absolute difference between any two chosen integers. Return the maximum possible score.
Example 1
start = [6,0,3], d = 2
Output: 4
Choose 8, 0 and 4: the closest pair differs by 4.
Example 2
start = [2,6,13,13], d = 5
Output: 5
Choose 2, 7, 13, 18.
Constraints: 2 ≤ start.length ≤ 10^5; 0 ≤ start[i] ≤ 10^9; 0 ≤ d ≤ 10^9.
Code runner format: one JSON value per line: start, then d. Implement maxPossibleScore(start, d).