A bar chart with forty thin bars is unreadable. The usual fix is to keep the most common categories and lump the rest into one bar called "Other".
Task: write top_bars(items, k). items is a list of category names, one per sale.
Return a list of [name, count] pairs:
k categories with the highest counts, biggest first["Other", total], where total is the number of sales in all the left-over categoriesIf there are k categories or fewer, there's no "Other" bar. No category is called "Other", and k is at least 1.