Flexport Interview Question

Question involving a dictionary, probability, and randomization