Pregunta de entrevista de Two Sigma

Debugging question and some tree/recursion question