Live Batches
Masterclasses
Menu
Free Courses
Account
Login / Sign Up
Problem Submissions Solution

Find Smallest Divisor Given A Threshold

Difficulty: Medium

Acceptance: 67.00%

Points: 30.00

You are given an array of integers nums[] and an integer threshold. You must choose a positive integer divisor and divide each element in the array by it. The result of each division is rounded up to the nearest integer. Return the smallest divisor such that the sum of all the division results is less than or equal to the threshold.

Topics

Companies

Articles

Examples:

N/A

Constraints:
  • 1 = nums.length = 5 × 104
  • 1 = nums[i] = 106
  • nums.length = threshold = 106
Companies:
Apple Samsung Visa Walmart
Topics:
Binary Search
Locked Content
Access Restricted: Please Login to access the code editor and test cases.