Problem 3455 · Hard

Shortest Matching Substring

Match a prefix, then a middle, then a suffix, always taking the earliest occurrence of each part; the shortest span wins.

Open the interactive visualisation