Problem 943 · Hard
Bitmask DP over visited words maximizing total suffix-prefix overlap, then rebuild the string.
Open the interactive visualisation