Loading problem...
You maintain a customer identity table named Person:
Because data can arrive from multiple sources, the same email may appear in multiple rows with different ids.
Your task is to produce a canonical registry where each email appears exactly once. For every duplicate group, keep only the row with the smallest id.
Return exactly these columns:
The final row order can be arbitrary unless your local checker enforces deterministic sorting.
This problem supports both:
Person:
| id | email |
|----|---------------------|
| 1 | alpha@shop.com |
| 2 | beta@shop.com |
| 3 | alpha@shop.com |[
{"id":1,"email":"alpha@shop.com"},
{"id":2,"email":"beta@shop.com"}
]The email alpha@shop.com appears twice, so only the row with the smallest id (1) is retained.
Person:
| id | email |
|----|------------------------|
| 9 | ops@infra.io |
| 7 | ops@infra.io |
| 5 | support@infra.io |
| 8 | support@infra.io |
| 6 | analytics@infra.io |[
{"id":6,"email":"analytics@infra.io"},
{"id":5,"email":"support@infra.io"},
{"id":7,"email":"ops@infra.io"}
]Within each email group, keep the minimum id. The input order is irrelevant.
Person:
| id | email |
|----|-----------------------------|
| 100 | data+ingest@platform.dev |
| 101 | data+ingest@platform.dev |
| 102 | billing-team@platform.dev |[
{"id":100,"email":"data+ingest@platform.dev"},
{"id":102,"email":"billing-team@platform.dev"}
]Alias-like locals (for example plus tags) are still plain strings in this task. Exact string equality defines duplicates.
Constraints