Dictionary and map
A dictionary, also called a map or associative array, connects a key to a value. Keys are unique, so the structure is useful when the main question is “Which value belongs to this identifier?”
The list in List preserves the report log, but opening report GS-2042 would require scanning it. Add a dictionary keyed by report ID when lookup is a frequent operation.
scores_by_name = empty dictionary
scores_by_name["Ada"] = 95
score = scores_by_name["Ada"]
Hash-based dictionaries usually provide average O(1) insertion, lookup, and removal. They require unique, usable keys and are not a replacement for structures that model order or relationships.
The dictionary handles report details, not whether an external event was already processed. The log and the lookup index remain separate responsibilities.
See Dictionary and map examples for runnable examples in supported programming languages.