← Goldman Sachs questions

Minimum Distance Between Midpoints of Two Word Occurrences

Filed under Goldman Sachs

Given a long string and two target words, calculate the minimum distance between the midpoints of the occurrences of the two given words in the string.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Goldman Sachs questions

Collected from public candidate posts and coding forums. Updated Nov 2026.