Pregunta de entrevista de Canva

Just a binary tree type leetcode question.