Pergunta de entrevista da empresa DoorDash

Binary Tree problem at screening.