Problem 1375 · Medium

Number of Times Binary String Is Prefix-Aligned

A string is prefix-aligned after step i when the largest flipped position so far equals i; count those steps.

Open the interactive visualisation