Find cost center leaders
Your task
A people directory draws an org chart from a flat roster. names holds one person per entry, and manager_of has the same length: entry i is the position of the person that person i reports to, or -1 for the single person at the top. The roster arrives in no particular order, so a manager can sit at a later position than the people reporting to them. Nobody reports to two managers and the chart never loops. Finance wants the leaders whose organization is big enough to earn its own cost center. A person's organization is everyone below them at any depth, direct reports plus their reports and onward, not counting the person. Return the names of the people whose organization holds at least min_reports people, in the order those people appear in names. An empty roster returns an empty list.
Examples
managers_over_headcount(names: list[str], manager_of: list[int], min_reports: int) -> list[str]managers_over_headcount(["Ada", "Bo", "Cy", "Di", "Eli"], [-1, 0, 0, 1, 1], 2)["Ada", "Bo"]managers_over_headcount(["rita", "sam", "tom"], [2, 2, -1], 1)["tom"]