Pregunta de entrevista de DoorDash

Binary Tree problem at screening.