← Questions

Parking lot occupancy peaks from entry and exit events

0
AmazonCodingLast asked Dec 2025

You get parking events [car_id, time, 'entry' | 'exit'], not necessarily in order.

  1. What is the largest number of cars that were in the lot at the same time?
  2. Return the time interval during which the lot held that many cars.
  3. The exit scanner is faulty and some exits were never recorded. Every car stays at most 2 hours, so a car with no exit is gone 2 hours after it entered. Answer part 2 again.
Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding