Python3 solution faster than 100%
\nimport math\nclass Solution:\n     def maxScore(self,nums: list[int]) -> int:\n        def product(array):\n            if len(array)!=0:\n                lcm
```\nimport math\nclass Solution:\n     def maxScore(self,nums: list[int]) -> int:\n        def product(array):\n            if len(array)!=0:\n                lcm = array[0]\n                gcd = array[0]\n                for x in range(len(array)):\n                    lcm = max(math.lcm(array[x],lcm),lcm)\n                    gcd = min(math.gcd(array[x],gcd),gcd)\n                return lcm*gcd \n        maximum = 0\n        if len(nums)>0:\n            nums.sort()\n            regularmax = product(nums)\n            if len(nums)==1:\n                return regularmax\n            for x in range(len(nums)):\n                arr = nums[:x] + nums[x+1:]\n                maximum = max(maximum,product(arr))\n                \n            return max(maximum,regularmax)\n        else:\n            return 1\n```
['Python', 'Python3']