Burn a Binary Tree with Parent Pointers

Problem

You are given a target node in a binary tree. Every node already has left, right, and parent pointers. The root's parent is None.

At time 0, only the target is burning. Every sec...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: