c++ Brute Force
\n Describe your approach to solving the problem. \n\n# Complexity\n- Time complexity: O(n * m)\nn = div.size(), m = nums.size()\n Add your time complexity here
\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: $$O(n * m)$$\nn = div.size(), m = nums.size()\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(1)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int maxDivScore(vector<int>& nums, vector<int>& div) {\n        int count = 0, divisor = 0;\n        for(int i = 0; i < div.size(); i++) {\n            int div_count = 0;\n            for(int j = 0; j < nums.size(); j++) {\n                if(nums[j] % div[i] == 0) div_count++;\n            }\n            if(count == div_count) {\n                divisor = divisor == 0 ? div[i] : min(divisor, div[i]);\n            }\n            else if(div_count > count) {\n                count = div_count;\n                divisor = div[i];\n            }\n        }\n        return divisor;\n    }\n};\n```
['Array', 'C++']