Your question is Deduplicate JSON Task Events. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Given a list of JSON strings, each representing a task event with fields task_id, status, and timestamp, write a function that returns a list of parsed task objects after removing duplicates. Two events are duplicates if they have the same task_id and status; keep only the one with the greatest timestamp. Ignore invalid JSON entries or entries missing any required field.
def deduplicate_events(events):