on 8 x 8 chessboard exactly white rook r number white bishop b black pawn p square when rook move choose cardinal direction north east south west move direction choose stop reach edge board capture black pawn block white bishop a rook consider attack pawn rook capture pawn rook turn the number available captures white rook number pawns rook attackingreturn number available captures white rook Example 1input board prppoutput 3explanation in example rook attack pawnsexample 2input board pppppppbpppbrbpppbpppppppoutput 0explanation the bishop block rook attack pawnsexample 3input board pppprpbbpoutput 3explanation the rook attack pawn position b5 d6 f5 Constraintsboardlength 8boardilength 8boardij r b pThere exactly cell boardij r