Pergunta de entrevista da empresa Yandex

LeetCode medium question on binary tree