![]() ![]() No two queens share a top-left to bottom-right diagonal.Įnter the no of rows for the square Board : 8 No two queens share a top-right to left-bottom diagonal.Ĥ. In previous solution we kept an 8-by-8 Boolean matrix and update it each time we placed a queen, but that required linear time to update as we need to check for safe cells.ģ. We need to figure out an efficient way of keeping track of which cells are under attack.
0 Comments
Leave a Reply. |