Simple Java Solution
Code\njava []\nclass Solution {\n    public long maxScore(int[] nums) {\n        long max=0;\n       for(int i=0;i<nums.length;i++)\n       {\n        int flag=
# Code\n```java []\nclass Solution {\n    public long maxScore(int[] nums) {\n        long max=0;\n       for(int i=0;i<nums.length;i++)\n       {\n        int flag=0;\n        long gcd=0,lcm=0;\n         for(int j=0;j<nums.length;j++)\n         {\n               if(i==j)\n               {\n                continue;\n               }\n               else\n               {\n                 if(flag==0)\n                 {\n                    gcd=nums[j];\n                    lcm=nums[j];\n                    flag=1;\n                 }\n                 else\n                 {\n                     long  a=gcd,b=nums[j];\n                     while(b>0)\n                     {\n                        long r=a%b;\n                        a=b;\n                        b=r;\n                     }\n                     gcd=a;\n                     a=lcm;\n                     b=nums[j];\n                     while(b>0)\n                     {\n                        long r=a%b;\n                        a=b;\n                        b=r;\n                     }\n\n                     lcm=(lcm*nums[j])/a;\n                    \n                 }\n               }\n         }\n         if(lcm*gcd>max)\n         {\n            System.out.println(lcm+" ||  "+gcd);\n            max=lcm*gcd;\n         }\n       }\n        long gcd=nums[0],lcm=nums[0];\n         for(int j=1;j<nums.length;j++)\n         {\n                    long a=lcm,b=nums[j];\n                     while(b>0)\n                     {\n                        long r=a%b;\n                        a=b;\n                        b=r;\n                     }\n                     lcm=(lcm*nums[j])/a;\n\n                    a=gcd;\n                    b=nums[j];\n                     while(b>0)\n                     {\n                        long r=a%b;\n                        a=b;\n                        b=r;\n                     }\n                     gcd=a;\n\n\n                      \n         }\n         if(lcm*gcd>max)\n         {\n            max=lcm*gcd;\n         }\n        \n       return max;\n         \n    }\n}\n```
['Java']