Code RoomLatest employee records
EasyPrep Room Coding #391

Latest employee records

CodingAlgorithms & data structuresEntry–Mid~12 min

An HR sync feed replays employee records in chronological order; each row is "id,name,title" and a later row for the same id fully replaces the earlier one. Return one row per id — the latest version — sorted by id ascending (plain string order; ids look like "e01"). Example: ["e02,raj,analyst", "e01,ava,engineer", "e02,raj,manager"] gives ["e01,ava,engineer", "e02,raj,manager"].

Implement
latest_records(rows: list[str]) → list[str]
Examples
in[["e02,raj,analyst","e01,ava,engineer","e02,raj,manager"]]out["e01,ava,engineer","e02,raj,manager"]
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 12 min
InputExpectedGot
[["e02,raj,analyst","e01,ava,engineer","e02,raj,manager"]]["e01,ava,engineer","e02,raj,manager"]not run yetsample