Pregunta de entrevista de TikTok

data structure design with O(1) complexity.