Sponsored
Use these hints if you're stuck. Try solving on your own first.
Sort elements and take each element from the largest until accomplish the conditions.
Solve with full IDE support and test cases