Pregunta de entrevista de Google Cloud

Leetcode question about binary tree