package leetcode;

/**
 * https://leetcode.com/problems/maximum-product-difference-between-two-pairs/
 */
public class Problem1913 {
    public int maxProductDifference(int[] nums) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Problem1913 prob = new Problem1913();
        System.out.println(prob.maxProductDifference(new int[]{5,6,2,7,4})); // 34
        System.out.println(prob.maxProductDifference(new int[]{4,2,5,9,7,4,8})); // 64
    }
}

@@ -12,16 +12,42 @@
 tcode;%0A%0A
+import java.util.Arrays;%0A%0A
 /**%0A * h
@@ -214,301 +214,112 @@
     
-// TODO%0A        return 0;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        Problem1913 prob = new Problem1913();%0A        System.out.println(prob.maxProductDifference(new int%5B%5D%7B5,6,2,7,4%7D)); // 34%0A        System.out.println(prob.maxProductDifference(new int%5B%5D%7B4,2,5,9,7,4,8%7D)); // 64
+Arrays.sort(nums);%0A        return (nums%5Bnums.length - 1%5D * nums%5Bnums.length - 2%5D) - (nums%5B1%5D * nums%5B0%5D);
 %0A   

Solve problem 1913