As reported: D. E. Shaw onsite round 2 (2026): a DSA question, LeetCode 1326 — Minimum Number of Taps to Open to Water a Garden, followed by Java multithreading concepts.
This is LeetCode 1326 — Minimum Number of Taps to Open to Water a Garden. Our write-up: /minimum-number-of-taps-to-open-to-water-a-garden.
A garden covers the segment [0, n] of the x-axis. There are n + 1 taps at the points 0, 1, …, n. Tap i, when open, waters [i − ranges[i], i + ranges[i]].
Return the minimum number of taps to open so that the whole garden [0, n] is watered, or -1 if that is impossible.
Example 1
n = 5, ranges = [3,4,1,1,0,0]
Output: 1
Tap 1 waters [-3, 5], the whole garden.
Example 2
n = 3, ranges = [0,0,0,0]
Output: -1
Constraints: 1 ≤ n ≤ 10^4; ranges.length == n + 1; 0 ≤ ranges[i] ≤ 100.
Code runner format: one JSON value per line: n, then ranges. Implement minTaps(n, ranges).