We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2c6fee7 commit 2f51714Copy full SHA for 2f51714
1913_Maximum_Product_Difference_Between_Two_Pairs.java
@@ -0,0 +1,11 @@
1
+// id: 1913
2
+// Name: Maximum Product Difference Between Two Pairs
3
+// link: https://leetcode.com/problems/maximum-product-difference-between-two-pairs/
4
+// Difficulty: Easy
5
+
6
+class Solution {
7
+ public int maxProductDifference(int[] nums) {
8
+ Arrays.sort(nums);
9
+ return (nums[nums.length-1]*nums[nums.length-2]) - (nums[0]*nums[1]);
10
+ }
11
+}
0 commit comments