Skip to content

Commit 93f5526

Browse files
committed
999. Available Captures for Rook
1 parent 8341f50 commit 93f5526

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Diff for: 0501-1000/0999. Available Captures for Rook.swift

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ class Solution {
33
// Solution by Sergey Leschev
44

55
// 999. Available Captures for Rook
6+
67
// On an 8 x 8 chessboard, there is exactly one white rook 'R' and some number of white bishops 'B', black pawns 'p', and empty squares '.'.
78
// When the rook moves, it chooses one of four cardinal directions (north, east, south, or west), then moves in that direction until it chooses to stop, reaches the edge of the board, captures a black pawn, or is blocked by a white bishop. A rook is considered attacking a pawn if the rook can capture the pawn on the rook's turn. The number of available captures for the white rook is the number of pawns that the rook is attacking.
89
// Return the number of available captures for the white rook.

0 commit comments

Comments
 (0)