Leetcode: Amount of Time for Binary Tree to Be Infected
A binary tree/graph problem
You are given the
root of a binary tree with unique values, and an integer
start. At minute
0, an infection starts from the node with value
Each minute, a node becomes infected if:
- The node is currently uninfected.
- The node is adjacent to an infected node.
Return the number of minutes needed for the entire tree to be infected.