Easiest Solution using Two For Loops
Intuition\nUsing two for loops to iterate through the arrays.\n\n# Approach\nBy taking the divisors one by one we count how many of elements of nums array are d
# Intuition\nUsing two for loops to iterate through the arrays.\n\n# Approach\nBy taking the divisors one by one we count how many of elements of nums array are divisible by the divisors. Bycomparing with maxScore we find the divisor element with max score.\n\n# Complexity\n- Time complexity:\nO(n2)\n\n- Space complexity:\nO(0)\n\n# Code\n```\nclass Solution {\n    public int maxDivScore(int[] nums, int[] divisors) {\n        Arrays.sort(divisors);\n        int maxScore=0;\n        int ans=0;\n        for(int i=0; i<divisors.length; i++){\n            int score=0;\n            for(int j=0; j<nums.length;j++){\n                if(nums[j]%divisors[i]==0){ //if the nums element is divisible by the divisor we increase the score by one\n                    score++;\n                }\n            }\n            if(score>maxScore){\n//compare the score with maximum score\n                maxScore=score;\n                ans=divisors[i];\n            }\n        }\n        \n        if(ans==0) return divisors[0];\n        \n    return ans;\n    }\n}\n```
['Array', 'Java']