Rotate image (square matrix) by 90 deg
Tue, 06 May 2025
Imagine you have infinite number of Queens.
Find the minimum number of queens required so that every square grid on the chess board is under the attack of a queen.
Arrange this minimum no. of Queens on a chess board.
Solution:
Easiest solution is to put a queen in all the squares (64 queens required). We can obviously do much better than this.
Queen @ every diagonalIf we put one queen at each diagonal cells (i.e put a queen when i==j). Then also all the cells in the chess-board will be under attack.

There will be more than one solution to the problem (If you rotate the chessboard, you will get another solution - if queens are non-symmetric).. Below is a solution with 5 queens:

Tue, 06 May 2025
Tue, 06 May 2025
Tue, 06 May 2025
Leave a comment