Pregunta de entrevista de Google

basic tree implementation, and a weirder medium difficulty one afterwards