Robinhood Interview Question

Some algorithm problems regarding dictionary and heap