Your goal is simple. Just turn all ends/connections on the grid so that there would be no open connections.

Just click on any connection to turn it.