Confusing Test Case

So I’m doing random problems for fun, and while doing this one, I noticed that this test case:

3
111
111
111

which supposedly outputs 1, should output 0. This is because if 1 was really painted first, then the rest of the 9 rectangles would have nowhere to go.

So I’m just asking why the answer is 1. Any help would be appreciated. Thanks!

I read the problem. Seems strange but it should be zero.

“Given the final state of the canvas, please count how many of the colors still visible on the canvas could have possibly been the first to be painted.”
Still visible: {1}
First to be painted (all colors 1-9 must be used once): {all but 1}
Out: 0

1 Like