Problem 1183 · Medium

Maximum Number of Ones

Every board cell falls in one residue class of the window side; keep the largest classes as ones within the allowed count.

Open the interactive visualisation