picture is a rectangular grid where every cell is either dark ("B") or light ("W").
A dark pixel is lonely when no other dark pixel shares its row or its column. Return the number of lonely dark pixels.picture=[["B", "W", "W"], ["W", "W", "B"], ["W", "W", "B"]] → 1
The corner pixel at (0, 0) is lonely. The two dark pixels in the last column spoil each other.
picture=[["W", "B"], ["B", "W"]] → 2
Both dark pixels are alone in their rows and columns.
"B" or "W"picture=[["B", "W", "W"], ["W", "W", "B"], ["W", "W", "B"]]
1
Run checks the first 3 tests in your browser. Submit checks all 80 tests on the server, hidden ones included.