Algorithm · Microsoft · Medium
You are given a flat list of employee records. Each record is a triple [employee_id, employee_name, manager_id], where manager_id is null for the chief executive. Build the reporting hierarchy from these records and return the employee names in level order, starting at the top. Finish an entire level before including anyone from the next level. Direct reports of the same manager must appear in the same order as they occur in the input list. If the records do not form a valid…
Checking your access…