Pregunta de entrevista de Autodesk

Question on binary trees and strings