Pregunta de entrevista de Tesla

Python related code challenges about state machine and tree data structures