← Back
00:00

Binary Tree Cameras

Amazon interview questions · Hard · Coding round · 6 tests

You are given the root of a binary tree. Place the minimum number of cameras so that every node is monitored.

A camera placed on a node monitors:

  • the node itself,
  • its parent,
  • its left child, and
  • its right child.

Interface

Idle