Pocket Gems interview question

parse ternary to binary tree