Code Room
CodingEasycod-g1230
Subject Data wranglingLevel Entry–Mid~11 minCommon in Algorithms & data structures interviewsIndustries Software development

Question

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.

Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.

Run or narrate your approach, then ask the coach.