Problem 2746 · Medium

Decremental String Concatenation

Track the shortest result for each pair of first and last letters as each word is joined on either side.

Open the interactive visualisation