values. Pick four elements at different indices and split them into two pairs. Subtract the product of the second pair from the product of the first.
Return the largest result you can get this way.values=[3, 9, 1, 6, 2] → 52
The first pair is 9 and 6 (product 54), the second is 1 and 2 (product 2). The difference is 54 − 2 = 52.
values=[5, 5, 5, 5] → 0
Whatever you pick, both pairs give 25, so the difference is 0.
values=[10, 1, 3, 10, 2, 7] → 98
values=[3, 9, 1, 6, 2]
52
Run checks the first 3 tests in your browser. Submit checks all 98 tests on the server, hidden ones included.