values. Pick two elements at different indices i and j and compute (values[i] − 1) · (values[j] − 1).
Return the largest value this expression can take.values=[6, 2, 9, 4] → 40
Take 9 and 6: (9 − 1) · (6 − 1) = 8 · 5 = 40.
values=[1, 7] → 0
There is no choice here: (1 − 1) · (7 − 1) = 0.
values=[4, 8, 8, 3] → 49
values=[6, 2, 9, 4]
40
Run checks the first 3 tests in your browser. Submit checks all 98 tests on the server, hidden ones included.