Problem 1284 · Hard

Minimum Number of Flips to Convert Binary Matrix to Zero Matrix

Encode the matrix as a bit mask and run BFS over masks, where each flip toggles a cell and its neighbours.

Open the interactive visualisation