This Solution You Will never Forget | | C++
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:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    long long gcd(long long a, long long b)\n    {\n        return (b==0) ? a : gcd(b,a%b);\n    }\n\n    long long findlcm(vector<int> &arr, int n)\n    {\n        long long lcm =arr[0];\n        for (int i = 1; i < n; i++){\n            lcm = (((arr[i] * lcm)) / (gcd(arr[i], lcm)));\n        }\n        return lcm;\n    }\n    long long findGCD(vector<int> &arr, int n)\n    {\n        long long result = arr[0];\n        for (int i = 1; i < n; i++)\n        {\n            result = gcd(arr[i], result);\n            if(result == 1) return 1;\n        }\n        return result;\n    }\n    long long maxScore(vector<int>& nums) {\n        if(nums.size()==1) return (1ll)*nums[0]*nums[0];\n        long long lcm = findlcm(nums,nums.size());\n        long long gcd1 = findGCD(nums,nums.size());\n        long long ans=(long long)lcm*gcd1;\n        for(int i=0;i<nums.size();i++){\n            vector<int> temp(nums.begin(),nums.end());\n            temp.erase(temp.begin()+i);\n            long long lcm2 = findlcm(temp,temp.size());\n            long long gcd2 = findGCD(temp,temp.size());\n            ans = max(ans,((long long)lcm2*gcd2));\n        }\n        return ans;\n    }\n};\n```
['C++']