← Amazon questions

Shortest sub-segment containing all target words

Filed under Amazon

Given a paragraph (list of words) and a set of k target words, find the shortest contiguous sub-segment in the paragraph that contains all k target words at least once.

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 Amazon questions

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