Points From Distinct Categories
Asked at Meta
Reported by the problem's creator, not verified
You are given items, a list of [category, points] pairs, and an integer k.
Examples
Example 1
Input: items =
[[1,10],[2,5],[1,7],[3,8]], k =2Output:
18Explanation: Category 1's best item is worth 10, category 2's is 5 and category 3's is 8. The two largest of these are 10 and 8, so the answer is 18. Taking 10 and 7 would reuse category 1.
Import your own questions
Paste a question you were asked and get a full problem: statement, tests and a checked solution.