Two liner || most DISGUSTING code you'll ever see
Code\npython3 []\nclass Solution:\n    def maxScore(self, nums: List[int]) -> int:\n        r = [[[n % q**i for i in range(1,5)].count(0) for q in (2,3,5,7,11,1
# Code\n```python3 []\nclass Solution:\n    def maxScore(self, nums: List[int]) -> int:\n        r = [[[n % q**i for i in range(1,5)].count(0) for q in (2,3,5,7,11,13,17,19,23,29)] for n in range(31)]  \n        return nums[0]** 2 if len(nums) == 1 else max((f := lambda l: prod((2,3,5,7,11,13,17,19,23,29)[i]**(min(s := [r[n][i] for n in l])+max(s)) for i in range(10)))(nums), max(f(c) for c in combinations(nums, len(nums)-1))) \n```\n# Notes\n<!-- Describe your first thoughts on how to solve this problem. -->\nTry submitting for yourself! Quite slow though\n\nJust for fun squeezed it into 2 lines - lots of disgusting use of lambda func, defining variables midline, if else midline...\n\nCant be bothered to explain but essentially stored each value of nums as its prime factor representation in r... then used the fact that gcd takes the min of prime powers of each element while lcm takes the max... and loop through combinations with one element removed.\n\nDone without both gcd and lcm functions from math module... stupid me didnt know there were already functions for them... \n\n\n  \n
['Python3']