Skip to content

Latest commit

 

History

History
11 lines (8 loc) · 422 Bytes

File metadata and controls

11 lines (8 loc) · 422 Bytes

Problem 18: Security Network (Cameras)

Problem Statement

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.

Input Format

  • The root of a binary tree.

Example

Input: root = [0, 0, null, 0, 0]
Output: 1