c++ solution
\n\nclass Solution {\npublic:\n    int maxDivScore(vector<int>& nums, vector<int>& divisors) {\n        int maxcount = 0;\n        int best_divisor = divisors[0
\n```\nclass Solution {\npublic:\n    int maxDivScore(vector<int>& nums, vector<int>& divisors) {\n        int maxcount = 0;\n        int best_divisor = divisors[0];\n        for (int i = 0; i < divisors.size(); i++) {\n            int count = 0;\n            for (int j = 0; j < nums.size(); j++) {\n                if (nums[j] % divisors[i] == 0) {\n                    count++;\n                }\n            }\n            if(count==maxcount){\n               best_divisor = min(best_divisor,divisors[i]);\n            }\n            if (count > maxcount) {\n                maxcount = count;\n                best_divisor = divisors[i];\n            }\n        }\n        return best_divisor;\n    }\n};\n\n\n\n```
['C++']