C++ Code with complexity O(n^2) and O(1)
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\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```cpp []\n#include<algorithm>\nclass Solution {\npublic:\n    long long maxScore(vector<int>& nums) {\n        int n = nums.size();\n        long long result = 0;\n        for(int i = -1;i<n;i++){\n            long long lcm=1,gcd=0;\n            for(int j = 0;j<n;j++){\n                if(i==j) continue;\n                gcd = __gcd(gcd,(long long)nums[j]);\n                lcm = (lcm*nums[j])/__gcd(lcm,(long long)nums[j]); \n            }\n\n            result = max(result,lcm*gcd);\n        }\n        return result;\n    }\n};\n```
['C++']