Problem 1585 · Hard

Check If String Is Transformable With Substring Sort Operations

Match the digits of the target in order, using the earliest unused source position for each and checking that no smaller digit is stuck behind it.

Open the interactive visualisation