Problem 943 · Hard

Find the Shortest Superstring

Bitmask DP over visited words maximizing total suffix-prefix overlap, then rebuild the string.

Open the interactive visualisation