Algorithm · Snapchat · Medium
You receive a collection of relationship rows. Each row is a list where the first element identifies a manager, and the subsequent elements name that manager's direct reports in the order they should be displayed. The complete set of rows describes a single, valid organizational tree rooted at one manager, who never appears as anyone's direct report. Each employee name is a non-empty ASCII string containing letters, digits, or underscores. Implement a function that takes…
Checking your access…