Problem 102 · Medium
BFS with a queue; drain each level completely before enqueuing the next layer.
Open the interactive visualisation