Goldman Sachs interview question

Leetcode easy regarding dictionaries (python)