-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Intuition
I don't know about chess, but got to know that this problem is famous while studying backtracking. There might be other folks the problem is unfamiliar like me, so I've looked through the leetcode discussion. I've noticed one of the comments saying:
It's not as daunting as it may seem, especially if you've tackled plenty of BFS/DFS problems before. (by ICalmPersonI)
Sure. It will be.
Assumption
The problem description does not have the details of when and how the queens would attack each other. Here is one of the discussions about this.
Q. In which case the two queen will attack each other? Sorry, I don't know the chessboard game. (by kaku770)
A. When they are at a diagonal position or in same row/column with respect to each other (by user4424gh)
Approach
Back tracking.
Performance
See also:
N-Queen Visualizer https://haseebq.com/n-queens-visualizer/
Solution
Complexity
- Time complexity:
- Space complexity:
Conclusion
Reference
Leet code discussions https://leetcode.com/problems/n-queens/description/
Metadata
Metadata
Assignees
Labels
Projects
Status