hall: 1 means a server sits in that cell, 0 means the cell is empty. Two servers can talk to each other if they are in the same row or the same column, no matter how far apart.
Return how many servers can talk to at least one other server.hall=[[1, 0, 1], [0, 0, 0], [0, 1, 0]] → 2
The two servers in the top row see each other. The server in the bottom row is alone in both its row and its column.
hall=[[1, 1], [0, 1]] → 3
The top-right server shares a row with the top-left one and a column with the bottom one, so all three are connected.
hall=[[0, 1], [1, 0]] → 0
hall=[[1, 0, 1], [0, 0, 0], [0, 1, 0]]
2
Run checks the first 3 tests in your browser. Submit checks all 53 tests on the server, hidden ones included.