🔥✅✅ Dart Solution 📌📌 || with Explanation 👌👌
Solution
scoreMap: This map stores the divisibility score for each divisor.
maxScore: This variable keeps track of the highest divisibility score found.
result:
# Solution

- **scoreMap**: This map stores the divisibility score for each divisor.
- **maxScore**: This variable keeps track of the highest divisibility score found.
- **result**: This variable stores the smallest divisor with the maximum score.

### Time Complexity:

- **Calculating Divisibility Scores**:
    - For each divisor, we iterate through the `nums` array. If there are `m` divisors and `n` numbers in `nums`, this step takes `O(m * n)` time.
- **Finding the Maximum Score**:
    - Iterating through the map to find the maximum score and the smallest divisor with that score takes `O(m)` time.
- **Overall Time Complexity**:
    - The dominant factor is the `O(m * n)` time complexity for calculating the scores.

```dart
class Solution {
  int maxDivScore(List<int> nums, List<int> divisors) {
    Map<int, int> scoreMap = {};
    for (int divisor in divisors) {
        int score = 0;
        for (int num in nums) {
            if (num % divisor == 0) {
                score++;
            }
        }
        scoreMap[divisor] = score;
    }
    int maxScore = -1;
    for (int score in scoreMap.values) {
        if (score > maxScore) {
        maxScore = score;
        }
    }
    int result = double.maxFinite.toInt();
    for (int divisor in scoreMap.keys) {
        if (scoreMap[divisor] == maxScore && divisor < result) {
            result = divisor;
        }
    }
    return result;
  }
}
```
['Dart']