#1090
Largest Values From Labels
specialist · 715 · lc medium +30 · 64.1% accepted · 495 likes · top 67%
Description
You have n items with values in values and labels in labels. Choose a subset of at most numWanted items such that no label appears more than useLimit times, maximizing the total value.
Return the maximum possible sum.
Code
1
2
3