C++ O(n) Solution
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: $O(n*m)$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $O(1)$\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>& div) {\n        int n=nums.size(),m=div.size(),mx=0,ans=div[0];\n        for(int i=0;i<m;i++){\n            int a=0;\n            for(int j=0;j<n;j++){\n                if(nums[j]%div[i]==0) a++;\n            }\n            if(a>mx){\n                mx=a;\n                ans=div[i];\n            }\n            if(a==mx && div[i]<ans) ans=div[i];\n        }\n        return ans;\n    }\n};\n```
['C++']