Largest Values From Labels — Lets Get Greedy

Today’s problem will be Largest Values from Labels.

The question asks us to return the largest possible sum of the subset S. This means we should probably order our items from largest to smallest, and then we can take the items if we have not used more than the use_limit. We can keep track of how many items of each label have been used by using a hash table.