Tap here to switch tabs
Problem
Submissions

Problem: Distribute Repeating Integers

med
30 min
Try to solve the Distribute Repeating Integers problem.

Statement

You are given an integer array nums of length n and an integer array quantity of length m, where the iextthi^{ ext{th}} customer demands quantity[i] integers.

Each customer must receive all identical integers from nums. Each element from nums can be assigned to at most 11 customer, and any remaining integers can be left unused.

Return true if it is possible to satisfy all mm customer requests, or false otherwise.

Constraints:

  • n ==== nums.length

  • 1≤n≤1051 \leq n \leq 10^5

  • 1≤1 \leq nums[i] ≤1000\leq 1000

  • m ==== quantity.length

  • 1≤m≤101 \leq m \leq 10

  • 1≤1 \leq quantity[i] ≤105\leq 10^5

  • There are at most 5050 unique values in nums.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Distribute Repeating Integers

med
30 min
Try to solve the Distribute Repeating Integers problem.

Statement

You are given an integer array nums of length n and an integer array quantity of length m, where the iextthi^{ ext{th}} customer demands quantity[i] integers.

Each customer must receive all identical integers from nums. Each element from nums can be assigned to at most 11 customer, and any remaining integers can be left unused.

Return true if it is possible to satisfy all mm customer requests, or false otherwise.

Constraints:

  • n ==== nums.length

  • 1≤n≤1051 \leq n \leq 10^5

  • 1≤1 \leq nums[i] ≤1000\leq 1000

  • m ==== quantity.length

  • 1≤m≤101 \leq m \leq 10

  • 1≤1 \leq quantity[i] ≤105\leq 10^5

  • There are at most 5050 unique values in nums.