Algorithm · Amazon · Medium
When combining two dictionaries (maps), the intended result is under-specified if the same key appears in both inputs. Define a merge operation for two dictionaries, then show how the same approach can be generalized to merge k dictionaries efficiently. Before describing an implementation, explain the design questions that must be answered first: how to handle duplicate keys, whether input dictionaries may be mutated, and whether key order in the output matters. Compare at…
Checking your access…