Pregunta de entrevista de Google

Trees and dynamic programming. It was leetcode medium