Smallest Divisor Given a Threshold
Medium
Binary Search on Answer
Find the smallest positive integer d such that the sum of ceil(nums[i] / d) over the array is at most threshold. Print d.
Constraints
1 <= n <= 5 * 10^4 1 <= nums[i] <= 10^6 n <= threshold <= 10^6
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.