Hard
You are given the root of a binary tree. A camera placed on a node can monitor its parent, itself, and its immediate children. Return the minimum number of cameras needed to monitor every node of the tree.
Input: root = [0,0,null,0,0] Output: 1
Input: root = [0,0,null,0,null,0,null,null,0] Output: 2