✅Easy C++ Solution || T.C : O(nm) , S.C:O(m)
Intuition\n Describe your first thoughts on how to solve this problem. \nThe given problem asks us to find the divisor in the input array divisors that has the 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nThe given problem asks us to find the divisor in the input array divisors that has the highest divisibility score in the input array nums.\n\nTo solve this problem, we need to iterate over each divisor and count the number of elements in nums that are divisible by the current divisor. We can store the score for each divisor in an unordered map. After calculating the score for each divisor, we can then find the divisor with the highest score and return it. If there are multiple divisors with the same highest score, we can break the tie by choosing the smallest divisor.\n\nThe intuition behind this approach is that the divisibility score for a divisor is simply the count of the number of elements in nums that are divisible by the divisor. By iterating over each divisor and counting the number of elements that are divisible by it, we can determine which divisor has the highest score. The use of an unordered map allows us to store the score for each divisor and quickly look up the score for a given divisor during the iteration.\n\nOverall, the approach is straightforward and efficient, with a time complexity of O(nm) and a space complexity of O(m).\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nThe approach of the given code is to use a nested loop to calculate the divisibility score of each divisor by iterating over the input array nums.\n\nFor each divisor, the code iterates over each element of nums and checks if the element is divisible by the current divisor. If it is, it increments the score for the divisor. Finally, the code checks which divisor has the highest score and returns it. If there are multiple divisors with the same highest score, it returns the smallest of them.\n\n# Complexity\n- Time complexity: O(nm)\n-  where n is the length of nums and m is the length of divisors. This is because for each divisor in divisors, the code iterates over each element in nums. However, since the length of divisors is at most 1000, this code should run efficiently for most practical inputs.\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(m)\n- where m is the length of divisors. This is because the code uses an unordered map to store the divisibility score for each divisor, which takes up space proportional to the number of divisors.\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>& divisors) {\n          unordered_map<int, int> mp;\n          int maxScore = 0, maxDivisor = INT_MAX;\n\n          for (int divisor : divisors) {\n              mp[divisor] = 0;\n          for (int num : nums) {\n              if (num % divisor == 0) {\n                mp[divisor]++;\n              }\n            }\n         if (mp[divisor] > maxScore) {\n            maxScore = mp[divisor];\n            maxDivisor = divisor;\n        }\n        else if (mp[divisor] == maxScore) {\n            maxDivisor = min(maxDivisor, divisor);\n        }\n      }\n    return maxDivisor;\n    }\n};\n```
['C++']