Pregunta de entrevista de Affirm

Insert, Delete, GetRandom O(1) Leetcode medium question but in Hackerrank

Respuesta de la entrevista

Anónimo

28 abr 2023

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.