Find the Maximum Divisibility Score || simple approach || c++
\n# Code\n\nclass Solution {\npublic:\n    int maxDivScore(vector<int>& nums, vector<int>& div) {\n        int maxcnt = 0;\n        int ans=INT_MAX;\n        fo
\n# Code\n```\nclass Solution {\npublic:\n    int maxDivScore(vector<int>& nums, vector<int>& div) {\n        int maxcnt = 0;\n        int ans=INT_MAX;\n        for(int i=0;i<div.size();i++){\n            int cnt=0;int f = 1;\n            for(int j=0;j<nums.size();j++){\n                if(nums[j]%div[i]==0){\n                    cnt++;\n                }\n            }\n            if(cnt>maxcnt){\n                ans = div[i];\n                maxcnt = cnt;\n            }else if(cnt==maxcnt){\n                ans = min(ans,div[i]);\n            }\n        }\n        return ans;\n    }\n};\n```
['C++']