Library Checkout Log
Asked at Meta
Reported by the problem's creator, not verified
A library records what happens to its books as a list of events. Each event is [timestamp, book_id, member_id, action], where timestamp is a decimal string of an integer and action is one of "checkout", "return" or "renew".
Examples
Example 1
Input: events =
[["1","b1","m1","checkout"],["2","b1","m1","renew"],["3","b1","m1","return"],["4","b1","m2","checkout"]]Output:
[true,-1]Explanation:
m1checksb1out, renews it and returns it. After the return the book is free, som2may check it out at time 4. Every event is allowed, so the answer is[True, -1].
Import your own questions
Paste a question you were asked and get a full problem: statement, tests and a checked solution.