Easy Java Solution || Beats 72% || ☻☻
IntuitionApproachComplexity
Time complexity:

Space complexity:
Do you want this code in other coding languages also ( Y/N ) , also comment your preferred codin
# 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:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n![Capture4.JPG](https://assets.leetcode.com/users/images/2438c681-5955-4c4b-af7d-43efd0a7bf3b_1734439856.3738673.jpeg)\n\n# Do you want this code in other coding languages also ( Y/N ) , also comment your preferred coding language.\n# Code\n```java []\nclass Solution {\n    public int maxDivScore(int[] nums, int[] divisors) {\n        int mscore = 0, mdivi = divisors[0], c = 0;\n        for (int i = 0; i < nums.length; i++) {\n            if (nums[i] % mdivi == 0)\n                mscore++;\n        }\n        for (int i = 1; i < divisors.length; i++) {\n            c = 0;\n            for (int j = 0; j < nums.length; j++) {\n                if (nums[j] % divisors[i] == 0)\n                    c++;\n            }\n            if (c > mscore || (c == mscore && divisors[i] < mdivi)) {\n                mscore = c;\n                mdivi = divisors[i];\n            }\n        }\n        return mdivi;\n    }\n}\n```\n# \u263B\u263B Please upvote if found helpful \u263B\u263B
['Array', 'Dynamic Programming', 'Counting', 'Java']