Insert, Delete, GetRandom O(1) Leetcode medium question but in Hackerrank
Anonymous
I managed to solve it by using a HashMap/Dictionary to store the customer ids and the associated merchant, then used a list to add/update as the functions were called, used the size of the list to get an index in the hashmap to return the merchant they wanted.
Check out your Company Bowl for anonymous work chats.