Unused departments
Finance audits the org chart for budget lines nobody uses. `departments` is the official list of department names (no duplicates); `employees` rows look like "name,dept". Return the departments with ZERO employees, sorted alphabetically. Employees whose dept is not in the official list can be ignored. Example: departments ["eng", "sales", "legal"] with employees ["ava,eng", "raj,eng"] give ["legal", "sales"].
Implement
empty_departments(departments: list[str], employees: list[str]) → list[str]Examples
in
[["eng","sales","legal"],["ava,eng","raj,eng"]]out["legal","sales"]What a strong answer looks like
State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.
0:00 of about 11 min
solution.py
InputExpectedGot
[["eng","sales","legal"],["ava,eng","raj,eng"]]["legal","sales"]not run yetsample