Interactive Brokers Interview Question

python coding question based on hashmap