2 Queues, one for current, one for parents....had little time, like 5 minutes to solve it so I did not put much into it, just came up with a working solution
Anoniem
21 jul 2016
Use a Queue for level order traversal and keep track of the level you are on (can get messy) and create a new List whenever you traverse to the next level in the tree.