Problem 2385 · Medium

Amount of Time for Binary Tree to Be Infected

Treat the tree as an undirected graph and spread infection outward from the start node with breadth-first search.

Open the interactive visualisation