Problem 199 · Medium
BFS level-order; record the last node of each level as the right-side view.
Open the interactive visualisation