Pergunta de entrevista da empresa Meta

Had a Binary tree question