Sumo Logic Interview Question

Tree Camera Problem from Leetcode