Company: Kickdrum_24sep
Difficulty: medium
Alert Propagation in Company Hierarchy Problem Description A company has n employees labeled 1..n, organized in a tree-like hierarchy. Each employee may have direct reports, and exactly one person is at the top (the CEO, the root). You are given the company hierarchy as a binary tree. Each Node represents an employee. Node->data is the employee ID. Node->left and Node->right represent their direct reports (if any). An urgent alert starts at the employee target . Every minute, any employee who knows the alert passes it to their manager, and their direct reports. Return the minimum number of minutes required for the alert to reach all employees. Input Format The tree is given as standard input (level-order representation of the company hierarchy). target the employee ID where the alert begins. Output Format Single integer minutes needed for the alert to reach everyone. Constraints 1 5 Employees are labeled 1..n The hierarchy is a valid tree Examples Example 1: Input: target = 5 root = [1