Solution 1: Insert implies Replace
Solution 2: Array elements are pointers to lists.
If we assume a uniform distribution over keys, a search is maintained.
If we can maintain performance for multiple entries for the same key, perhaps we can do the same while mapping multiple keys into the same array element.
In other words, use Hash Tables.