[Brute Force] 🤩🔥 | | C++
Complexity

Time complexity:
O(n∗m)


Space complexity:
O(n+m)

Code
# Complexity
- Time complexity:
$$O(n*m)$$

- Space complexity:
$$O(n+m)$$

# Code
```cpp []
class Solution {
public:
    int maxDivScore(vector<int>& nums, vector<int>& divisors) {
        int count = 0;
        vector<int> store;
        for (int i = 0; i < divisors.size(); i++) {
            count = 0;
            for (int j = 0; j < nums.size(); j++) {
                if (nums[j] % divisors[i] == 0) {
                    count += 1;
                }
            }
            store.push_back(count);
        }

        int max = INT_MIN;
        for (int i = 0; i < store.size(); i++) {
            if (max < store[i]) {
                max = store[i];
            }
        }

        vector<int> divisor;
        for (int j = 0; j < store.size(); j++) {
            if (store[j] == max) {
                divisor.push_back(divisors[j]);
            }
        }

        if (divisor.size() == 1) {
            return divisor[0];
        }

        int min = INT_MAX;
        for (int i = 0; i < divisor.size(); i++) {
            if (min > divisor[i]) {
                min = divisor[i];
            }
        }
        return min;
    }
};
```
['Array', 'C++']