Problem 1055 · Medium

Shortest Way to Form String

Build the target from independent subsequences of source, each walking source once and taking every letter it can.

Open the interactive visualisation