Bloomberg interview question

LC Medium question about binary trees.