Goldman Sachs interview question

Dictionary finding on a string. Easy-medium level