Algorithm · Waymo · Medium
An autonomous vehicle keeps a log of its maintenance events. Your job is to check two things: whether the log itself is well-formed, and whether, after every event has been applied, the vehicle is ready to go. Every event is written as [action, time, type]: action takes one of two values, open or end. time is a timestamp given as a non-negative integer. type names a maintenance category, for example oil or brake. Events arrive sorted so that time never decreases. An open…