> For the complete documentation index, see [llms.txt](https://hao-fu-1.gitbook.io/oj/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hao-fu-1.gitbook.io/oj/greedy/binary-tree-cameras.md).

# Binary Tree Cameras

<https://leetcode.com/problems/binary-tree-cameras/>

> Given a binary tree, we install cameras on the nodes of the tree.
>
> Each camera at a node can monitor its parent, itself, and its immediate children.
>
> Calculate the minimum number of cameras needed to monitor all nodes of the tree.

![](https://2251957238-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LcOoIFG2VRxGaJDySQN%2F-LcOoJHd7TzQh5w1SKcJ%2F-LcOon3gx4pBzw7e4eP4%2F968.png?generation=1555211455410249\&alt=media)

![](https://2251957238-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LcOoIFG2VRxGaJDySQN%2F-LcOoJHd7TzQh5w1SKcJ%2F-LcOon3iUKJUtvngMzR4%2F968_2.png?generation=1555211453553450\&alt=media)

## Thoughts
