Pergunta de entrevista da empresa Wish

Algorithm problem about binary trees