Problem 1562 · Medium

Find Latest Group of Size M

Flip bits one at a time and track run lengths at run endpoints to find the last moment a run of exactly m ones exists.

Open the interactive visualisation