✅✅ BEST C++ ( well Explained ) + ( Brute force )💯💯 ⬆⬆⬆⬆
\n\n# Approach\n Describe your approach to solving the problem. \ntake divisor and check for every element of num is divisible or not and count the total number
\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\ntake divisor and check for every element of num is divisible or not and count the total number of divisible number.\nafter that store it to the map. if same divisor come more then one time then we dont calculate it multiple time it is already stored in our map. simply skip same divisor.\n\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n***O(N * M)***\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n***O(1)***\n\n# Code\n```\nclass Solution {\npublic:\n    int maxDivScore(vector<int>& nums, vector<int>& divisors) {\n        map<int, int> mp;\n        for(int i=0; i<divisors.size(); i++)    {\n            int cnt = 0;\n            // same number comming then skip it ::\n            if(mp.find(divisors[i]) != mp.end())    continue;\n\n            // count the number of divisible element in nums\n            for(int j=0; j<nums.size(); j++)    \n                if(nums[j] % divisors[i] == 0)  cnt++;\n            \n            mp[divisors[i]] = cnt;\n        }\n        int ans = *min_element(divisors.begin(), divisors.end());\n        int cnt = mp[ans];\n        for(auto it : mp)   {\n            if(it.second > cnt) {\n                cnt = it.second;\n                ans = it.first;\n            }\n        }\n        return ans;\n    }\n};\n```
['Array', 'Ordered Map', 'C++']