Latest employee records

Write codeEasy12 minDatabricks style

Your task

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"].

Examples

latest_records(rows: list[str]) -> list[str]
Example 1
Inputlatest_records(["e02,raj,analyst", "e01,ava,engineer", "e02,raj,manager"])
Output["e01,ava,engineer", "e02,raj,manager"]