Skip to main content
added 196 characters in body
Source Link
SQLnoob
  • 8.6k
  • 30
  • 46

Assuming adjacent means they share an edge, then a trivial solution where some white squares exist is

just paint everything except the first and last rows black. Then each white square in the first and last rows is touching exactly one black square.

If adjacency includes squares that touch diagonally, then something simple like these should work:

enter image description here

Assuming adjacent means they share an edge, then a trivial solution where some white squares exist is

just paint everything except the first and last rows black. Then each white square in the first and last rows is touching exactly one black square.

Assuming adjacent means they share an edge, then a trivial solution where some white squares exist is

just paint everything except the first and last rows black. Then each white square in the first and last rows is touching exactly one black square.

If adjacency includes squares that touch diagonally, then something simple like these should work:

enter image description here

Source Link
SQLnoob
  • 8.6k
  • 30
  • 46

Assuming adjacent means they share an edge, then a trivial solution where some white squares exist is

just paint everything except the first and last rows black. Then each white square in the first and last rows is touching exactly one black square.