O(n^2) solution 7 line AC code (bruteforce)
Intuition\nYes gcd and lcm pre-exist for array in python as well which i don\'t know during contest.\n# Approach\nyes this is an easy code with self explainatio
# Intuition\nYes gcd and lcm pre-exist for array in python as well which i don\'t know during contest.\n# Approach\nyes this is an easy code with self explaination \n# Complexity\n- Time complexity: $$O(n^2)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:$$O(n)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```python3 []\nclass Solution:\n    def maxScore(self, nums: List[int]) -> int:\n        ans=gcd(*nums)*lcm(*nums) #whole array\n        for i in range(len(nums)):\n            temp=(nums[:i]+nums[i+1:]) #skipping ith index\n            g=gcd(*temp)\n            l=lcm(*temp)\n            ans=max(ans,l*g)\n        return ans\n```
['Python3']