← Questions
Time for an infection to spread through a binary tree
0
I was asked this
No reports yet. Sign in to say where you were asked it.
A binary tree catches fire (or an infection) at one given node. Every minute it spreads to the neighbours of each burning node: its children and its parent. Return how many minutes it takes for the whole tree to burn. Build parent links (or an adjacency list) and run a BFS from the start node.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Sign in to submit your code; every attempt is kept here.
Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding
