2022-08-24 14:28:45 +02:00

1.2 KiB

Hints

General

1. Given a Chessboard and a Rank, count how many squares are occupied

2. Given a Chessboard and a File, count how many squares are occupied

  • You'll first need to check the file is within range.
  • Loop over the chessboard.
  • Add one if the square is occupied.

3. Count how many squares are present in the given chessboard

  • There are many ways to solve this.
  • This should return how many squares are configured in a chess-board.

4. Count how many squares are occupied in the given chessboard

  • Get the CountInRank for all ranks in the chessboard.