Pregunta de entrevista de Meta

Two coding tasks: first one about strings, second one about binary tree