First-time buyers
Your task
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].
Examples
first_time_buyers(history: list[int], today: list[int]) -> list[int]Example 1
Input
first_time_buyers([1, 2, 3], [3, 4, 4, 5])Output
[4, 5]