Superhuman Interview Question

Parse and generate a unbalanced tree