Meta interview question

Building a tree, operating with map