Minimum Number of Valid Strings to Form Target I
Mark how far each target position can reach with a valid prefix, then run a shortest-path style DP over those reaches.
Mark how far each target position can reach with a valid prefix, then run a shortest-path style DP over those reaches.