values. You may remove any number of its elements, but at least one must stay. After the removal, all remaining numbers must be **pairwise distinct**.
Return the largest possible sum of the remaining numbers.values=[3, -2, 3, 5, 0] → 8
Remove -2 and one of the 3s, leaving [3, 5, 0]: no repeats and the sum is 8.
values=[-7, -4, -4] → -4
Every number is negative and the array may not become empty, so the best choice is to keep a single -4.
values=[10, -1, 2, 10, 2] → 12
values=[3, -2, 3, 5, 0]
8
Run checks the first 3 tests in your browser. Submit checks all 124 tests on the server, hidden ones included.