Pocket Gems interview question

construct a trinary tree given string input