Ciena interview question

Tree and string manipulation