Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Consider the items in order from largest to smallest value, and greedily take the items if they fall under the use_limit. We can keep track of how many items of each label are used by using a hash table.