How would you implement a custom dictionary where one key maps to multiple generic values, including the operations you would expose and their complexity?
Implement custom_dictionary(operations). Keys must be hashable, values may be any Python object, and values for each key must preserve insertion order. Each operation is a dictionary with op equal to add, get, remove, or contains. Return results for get, remove, and contains in operation order: get returns a list of values, remove returns whether one matching value was removed, and contains returns whether the key exists.
def custom_dictionary(operations):