Find the Smallest Divisor Given a Threshold
MediumLeetCodeBinary Search on Answer
Approach hintTry it first, then revealHide
The sum of ceil(nums[i] / d) can only shrink as d grows, so binary search the smallest divisor in [1, max(nums)] whose sum stays within the threshold.