Fast solurtion C#
\n# Complexity\n- Time complexity: O(n ^ 2)\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# Complexity\n- Time complexity: O(n ^ 2)\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```csharp []\npublic class Solution {\n    public long MaxScore(int[] nums) {\n        if(nums.Length == 1)\n        {\n            return (long)nums[0] * nums[0];\n        }\n        long max = 0;\n        long gcd = nums[0];\n        long lcm = nums[0];\n        for(int i = 1; i < nums.Length; i++)\n        {\n            gcd = GCD(gcd, nums[i]);\n            lcm = LCM(lcm, nums[i]);\n        }\n        max = lcm * gcd;\n        for(int i = 0; i < nums.Length; i++)\n        {\n            long currGCD = 0;\n            long currLCM = 1;\n            for(int j = 0; j < nums.Length; j++)\n            {\n                if(j == i)\n                {\n                    continue;\n                }\n                currGCD = currGCD == 0 ? nums[j] : GCD(currGCD, nums[j]);\n                currLCM = LCM(currLCM, nums[j]);\n            }\n            max = Math.Max(max, currLCM * currGCD);\n        }\n        return max;\n    }\n\n    public long GCD (long first, long second)\n    {\n        while(second != 0)\n        {\n            long temp = second;\n            second = first % second;\n            first = temp;\n        }\n        return first;\n    }\n\n    public long LCM (long first, long second)\n    {\n        return first * second / (GCD(first, second));\n    }\n}\n```\n![89f26eaf70fa927a79d4793441425859.jpg](https://assets.leetcode.com/users/images/34b433ac-c254-47eb-8654-8ab85ab43677_1730545156.4143603.jpeg)\n
['Array', 'Math', 'C#']