Tap here to switch tabs
Problem
Submissions

Problem: Find the Maximum Divisibility Score

med
30 min
Try to solve the Find the Maximum Divisibility Score problem.

Statement

You are given two integer arrays, nums and divisors.

The divisibility score of an element divisors[j] is defined as the number of indices i such that nums[i] is divisible by divisors[j].

Return the integer in divisors that achieves the maximum divisibility score. If multiple values in divisors share the same maximum score, return the one with the smallest numeric value.

Constraints:

  • 1≤1 \leq nums.length, divisors.length ≤1000\leq 1000

  • 1≤1 \leq nums[i], divisors[i] ≤109\leq 10^9

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Find the Maximum Divisibility Score

med
30 min
Try to solve the Find the Maximum Divisibility Score problem.

Statement

You are given two integer arrays, nums and divisors.

The divisibility score of an element divisors[j] is defined as the number of indices i such that nums[i] is divisible by divisors[j].

Return the integer in divisors that achieves the maximum divisibility score. If multiple values in divisors share the same maximum score, return the one with the smallest numeric value.

Constraints:

  • 1≤1 \leq nums.length, divisors.length ≤1000\leq 1000

  • 1≤1 \leq nums[i], divisors[i] ≤109\leq 10^9