C++ || Easy approach
Here is my c++ code for this problem.\n\n# Complexity\n- Time complexity:O(n*m)\n\n- Space complexity:O(1)\n\n# Code\n\nclass Solution {\npublic:\n    int maxDi
Here is my c++ code for this problem.\n\n# Complexity\n- Time complexity:$$O(n*m)$$\n\n- Space complexity:$$O(1)$$\n\n# Code\n```\nclass Solution {\npublic:\n    int maxDivScore(vector<int>& n, vector<int>& d) {\n        int cnt1=0, cnt2=0;\n        for (int i=0; i<d.size(); i++){\n            int l=0;\n            for (int j=0; j<n.size(); j++){\n                if (n[j]%d[i]==0){\n                    l++;\n                }\n            }\n            if (l>cnt1){\n                cnt1=l;\n                cnt2=i;\n            }\n            else if (l==cnt1 && d[i]<d[cnt2]){\n                cnt2=i;\n                cnt1=l;\n            }\n        }\n        return d[cnt2];\n    }\n};\n```
['C++']