← Questions

Validate checkout and return logs

0
MetaCodingLast asked Sep 2025

Given a log of events per book, each a checkout or a return (a true/false flag), check that every book's events alternate correctly: a book must be checked out before it can be returned, and it cannot be checked out twice in a row. Report which books have invalid histories.

Write and test your solution herePython in your browser, the question's tests level by level, saved for you.Sign in to start coding