Simple java 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(m*n)$$\n\n- Space complexity: $$O(1)$$\n\n# Code\n```\nclass Solution {\n    public int maxDivScore(int[] nums, int[] divisors) {\n        int max=0,val=0;\n        for(int i:divisors)\n        {\n            int count=0;\n            for(int j:nums)\n            {\n                if(j%i==0)\n                {\n                    count++;\n                }\n            }\n            if(count>max)\n            {\n                max=count;\n                val=i;\n            }\n            if(count==max && i<val)\n            {\n                val=i;\n            }\n        }\n        if(max==0 && val==0)\n        {\n            Arrays.sort(divisors);\n            return divisors[0];\n        }\n        return val;\n    }\n}\n```
['Java']