Sponsored
Use these hints if you're stuck. Try solving on your own first.
Sort the Array.
Decrement each element to the largest integer that satisfies the conditions.
Solve with full IDE support and test cases