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.
[1, 1000]Node.val == 0root = [0,0,null,0,0]1root = [0,0,null,0,null,0,null,null,0]2