Code RoomRemove rows that repeat exactly
EasyPrep Room Coding #5038

Remove rows that repeat exactly

CodingAlgorithms & data structuresEntry–Mid~7 min

Given `contacts` with columns `email` and `name`, drop rows that duplicate another row across BOTH columns, keeping the first. Return `email` and `name`, sorted by `email` ascending and then `name` ascending.

Implement
dedupe_rows(contacts: dataframe) → dataframe
Examples
in[{"__df__":[{"name":"Ann","email":"a@x.com"},{"name":"Bob","email":"b@x.com"},{"name":"Ann","email":"a@x.com"},{"name":"Cy","email":"c@x.com"},{"name":"Bobby","email":"b@x.com"}]}]out[{"name":"Ann","email":"a@x.com"},{"name":"Bob","email":"b@x.com"},{"name":"Bobby","email":"b@x.com"},{"name":"Cy","email":"c@x.com"}]
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.

0:00 of about 7 min
InputExpectedGot
[{"__df__":[{"name":"Ann","email":"a@x.com"},{"name":"Bob","email":"b@x.com"},{"name":"Ann","email":"a@x.com"},{"name":"Cy","email":"c@x.com"},{"name":"Bobby","email":"b@x.com"}]}][{"name":"Ann","email":"a@x.com"},{"name":"Bob","email":"b@x.com"},{"name":"Bobby","email":"b@x.com"},{"name":"Cy","email":"c@x.com"}]not run yetsample