FunctionRacerProblemsRace

Earning More Than the Manager

MediumpandasPython

staff has columns id, name, salary and manager_id. manager_id is the id of that person's manager, or None for the boss. Return a list of the names of people who earn more than their own manager, in the order they appear.

Example 1

staff {"id":[1,2,3],"name":["Joe","Sam","Max"],"salary":[50,60,90],"manager_id":[3,1,null]}
returns ["Sam"]

Joe (50) has manager Max (90), but Sam (60) earns more than his manager Joe (50).

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More pandas problems