Binary Tree Cameras || Leetcode Hard 968
Автор: Digital Interview
Загружено: 2022-06-17
Просмотров: 128
Описание:
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.
Example 1:
Input: root = [0,0,null,0,0]
Output: 1
Explanation: One camera is enough to monitor all nodes if placed as shown.
#leetcode #leetcodechallenge
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: