← All problemsSign in

2385. Amount of Time for Binary Tree to Be Infected

LeetCodeHash TableTreeDepth-First SearchBreadth-First SearchBinary TreeOpen on judge ↗

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 start. 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. Example 1: Input: root = [1,5,3,null,4,10,6,9,2], st

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start