Domanda di colloquio di Aurora Innovation

Data structure question, had to be solved in python.