Sponsored
Use these hints if you're stuck. Try solving on your own first.
Can we use sorting and two pointers here?
Assign every element the next bigger unused element as many times as possible.
Solve with full IDE support and test cases