Pregunta de entrevista de Interactive Brokers

python coding question based on hashmap