Solve the following coding tasks:
-
Maximum Points from Different Categories: Given an array of items (category, points) and an integer k, choose exactly k items with all categories distinct to maximize the total points. Return the maximum achievable sum.
-
Library Location Management: Design a data structure to manage book locations in a library. Support add(book_id, location), move(book_id, new_location), remove(book_id), and get_location(book_id) in efficient time, where location may include branch, aisle, shelf, and position.
-
Book Checkout Log Validation: Given a chronological list of events (timestamp, book_id, member_id, action in {checkout, return, renew}), validate the log. A book cannot be held by multiple members simultaneously; returns must follow a checkout; renewals only by the current holder; and timestamps for the same book must be non-decreasing. Return a boolean and, if invalid, the index of the first violating event.
-
Two String Validation (no Counter): Given two lowercase strings s and t, determine whether they are anagrams of each other using only basic data structures (e.g., arrays or dicts) and without using collections.Counter. Return true or false.