Algorithm · Meta · Medium
A city library records every completed book as a (category, points) pair. You need to calculate the largest total score a reader can claim while following these rules: At most three books can contribute points to the total. All contributing books must come from different categories; in other words, use no more than one book per category. Fewer than three books are allowed when fewer than three categories are present. Implement the function below. It should return the largest…
Checking your access…