🥁EASY SOLUTION EXPLAINED
\n\n# \uD83D\uDC93**_PLEASE CONSIDER UPVOTING_**\uD83D\uDC93\n\n \n\n\n\n# \u2B50 Intuition\nThe goal is to maximize the "factor score," defined as the product 
<div align="center">\n\n# \uD83D\uDC93**_PLEASE CONSIDER UPVOTING_**\uD83D\uDC93\n\n</div>\n\n***\n\n# \u2B50 Intuition\nThe goal is to maximize the "factor score," defined as the product of the array\'s GCD and LCM, after potentially removing one element. Calculating the factor score for different subsets of the array (where each subset excludes one element) allows us to find the maximum possible score.\n\n# \u2B50 Approach\n1. **Calculate Initial GCD and LCM**:\n   - Compute the GCD and LCM of the entire array to establish a baseline factor score. This score is used as one possible answer.\n2. **Check Factor Scores with Each Element Removed**:\n   - For each element in the array, calculate the GCD and LCM of the subset of the array that excludes that element.\n   - Compute the factor score for this subset and update the maximum score if this factor score is higher.\n3. **Return the Maximum Score**:\n   - After calculating scores with each element excluded, return the maximum factor score found.\n\n# \u2B50 Complexity\n- **Time Complexity**: $$O(n^2)$$, as we need to calculate the GCD and LCM while iterating over each possible subset.\n- **Space Complexity**: $$O(1)$$, aside from the input and output storage, as we only store a few auxiliary variables.\n\n# \u2B50 Code\n```java []\nclass Solution {\n    public long gcd(long a, long b) {\n        if (b == 0) return a;\n        return gcd(b, a % b);\n    }\n\n    public long lcm(long a, long b) {\n        return (a * b) / gcd(a, b);\n    }\n\n    public long maxScore(int[] arr) {\n        long arrayGCD = 0;\n        long arrayLCM = 1;\n\n        for (int num : arr) {\n            arrayGCD = gcd(arrayGCD, num);\n            arrayLCM = lcm(arrayLCM, num);\n        }\n\n        long maxFactor = arrayGCD * arrayLCM;\n\n        for (int i = 0; i < arr.length; i++) {\n            long subGCD = 0;\n            long subLCM = 1;\n\n            for (int j = 0; j < arr.length; j++) {\n                if (i != j) {\n                    subGCD = gcd(subGCD, arr[j]);\n                    subLCM = lcm(subLCM, arr[j]);\n                }\n            }\n\n            maxFactor = Math.max(maxFactor, subGCD * subLCM);\n        }\n\n        return maxFactor;\n    }\n}\n```
['Math', 'Java']