#999
Available Captures for Rook
pupil · 330 · lc easy +22 · 71.5% accepted · 805 likes · top 80%
Description
You are given an 8 x 8 matrix representing a chessboard containing exactly one white rook 'R', some white bishops 'B', some black pawns 'p', and empty squares '.'.
The rook attacks along rows and columns and is blocked by any other piece.
Return the number of black pawns the white rook can capture in a single move.
Code
1
2
3