Question
A sales team wants product breadth per region, not volume. Each row is "region,product,amount"; the same region-product pair can recur across many sales. Return a dictionary mapping each region to how many DISTINCT products it sold (the amount is irrelevant). Example: ["west,mug,10", "west,mug,20", "west,tee,5", "east,cap,7"] gives {"west": 2, "east": 1}.
distinct_products(rows: list[str]) → dict[str,int][["west,mug,10","west,mug,20","west,tee,5","east,cap,7"]]out{"east":1,"west":2}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.