Validate Book Checkout and Return Logs

Problem

Given a chronological list of book checkout and return logs, determine whether the sequence is valid.

Each entry is LogEntry(bookId: int, isCheckout: bool):

  • bookId uniquely identifie...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: