Binary Tree Cameras at MathWorks

Hard47.6% acceptance

This problem has 87.5% frequency at MathWorks.

Problem Description

You are given the `root` of a binary tree. We install cameras on the tree nodes where each camera at a node can monitor its parent, itself, and its immediate children. Return _the minimum number of cameras needed to monitor all nodes of the tree_.

Read full problem and hints

Topics

Also asked at 14 companies


More MathWorks Questions

View all MathWorks questions