Problem 3998 · Medium

Transform Binary String Using Subsequence Sort

Sorting any chosen subsequence only moves zeros left. A pattern is reachable when some filling of its question marks keeps the zeros of the candidate ahead of the original at every prefix.

Open the interactive visualisation