Sponsored
Use these hints if you're stuck. Try solving on your own first.
Sort the array.
Try to reduce all elements with maximum value to the next maximum value in one operation.
Solve with full IDE support and test cases