Problem 2661 · Medium
Paint cells in the given order while counting each row and column, and stop at the first full line.
Open the interactive visualisation