Find the Smallest Divisor Given a Threshold
mediumFind the smallest divisor such that sum of ceil(nums[i]/divisor) is within threshold
Smallest Divisor Given a Threshold
Key Insight
Binary search divisor; feasibility is monotonic because larger divisors never increase required sum.
Step 1Setup
Threshold = 6
L
1
02
15
29
3Search space: [1..9]
Binary search divisor from 1 to max(nums).
1 / 3