Goldman Sachs Interview Question

Dictionary finding on a string. Easy-medium level