Design a function that merges offline mobile actions into server state. Each action has an item_id, operation type, timestamp, and op_id; duplicate retries must be ignored, the merge order must be deterministic, and conflicting items must be returned separately.
local_ops: list of (item_id, op_type, timestamp, op_id)server_state: current item state before syncremote_changes: list of (item_id, op_type, timestamp)(final_state, conflicts)op_id values