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 hintsTopics
Also asked at 14 companies
More MathWorks Questions
Minimum Cost Tree From Leaf ValuesMediumShopping OffersMediumMinimum Edge Reversals So Every Node Is ReachableHardString TransformationHardSplit Array Largest SumHard
View all MathWorks questions