Your question is Merge Duplicate Dataset Records. 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 records records, where each record is a list [id, value, timestamp], merge all records with the same id. For each id, return one record [id, total_value, latest_timestamp] where total_value is the sum of all values for that id and latest_timestamp is the maximum timestamp seen for that id. Return the final list sorted by id in ascending order.
def merge_records(records):