Sponsored
Use these hints if you're stuck. Try solving on your own first.
Map the weights using the corresponding values as keys.
Make sure your output is sorted in ascending order by value.
Solve with full IDE support and test cases