#2644

Find the Maximum Divisibility Score

easy · 51.7% accepted · 248 likes · top 41%

array

⊣ practice⊣ open on leetcode ↗

Description

You are given two integer arrays nums and divisors.

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

Return the integer divisors[i] with the maximum divisibility score. If multiple integers have the maximum score, return the smallest one.

Solution