Distribute Repeating Integers

You are given an array of n integers, nums, where there are at most 50 unique values. You are also given an array of m customer order quantities, quantity, where quantity[i] is the amount of integers the ith customer ordered.

Determine if it is possible to distribute nums such that:

  • The ith customer gets exactly quantity[i] integers,
  • The integers the ith customer gets are all equal, and
  • Every customer is satisfied.

Return true if it is possible to distribute nums according to the above conditions, otherwise return false.

The actual values in nums do not matter, only how many times each value appears. Count the occurrences of every distinct value first, then decide which customers each value can serve.

Examples
Input: [[1,2,3,4],[2]]
Output: false
Hints

Distribute Repeating Integers

You are given an array of `n` integers, `nums`, where there are at most `50` unique values. You are also given an array of `m` customer order quantities, `quantity`, where `quantity[i]` is the amount of integers the `ith` customer ordered.