Pergunta de entrevista da empresa Autodesk

Question on binary trees and strings