Excellent Logic Using Sort in Java
\n\n#  Superb Logic in java\n\nclass Solution {\n    public int maxProductDifference(int[] nums) {\n        Arrays.sort(nums);\n        int n =nums.length;\n   
\n\n#  Superb Logic in java\n```\nclass Solution {\n    public int maxProductDifference(int[] nums) {\n        Arrays.sort(nums);\n        int n =nums.length;\n    return nums[n-1]*nums[n-2]-nums[0]*nums[1];\n    }\n}\n```\n# please upvote me it would encourages me so much
['Java']