Code Room
CodingEasycod-g1194
Subject ArraysLevel Entry–Mid~11 minCommon in Algorithms & data structures interviewsIndustries Software development

Question

A shop compares today's buyers against its history. Given the list of customer IDs that have ever purchased before and the list of IDs that purchased today (repeats possible in both), return the IDs of today's first-time buyers — those that appear today but nowhere in the history — as an ascending list without duplicates. Example: history [1, 2, 3], today [3, 4, 4, 5] gives [4, 5].

Implement
first_time_buyers(history: list[int], today: list[int]) → list[int]
Examples
in[[1,2,3],[3,4,4,5]]out[4,5]
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.