LinkedIn interview question

TP2: Print tree level by level