9 queens be set on chessboard | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

9 queens be set on chessboard

how to set 9 queens on the chessboard such that they don't cut each other horizontally, vertically and diagonally

13th Aug 2018, 4:11 PM
Uttam Kumar Yadav
2 Answers
+ 9
You can use this script if you like. Anything up to 6 queens is no problem, more than that might take a couple of hours to calculate (and will definitely not work in Sololearn) /Edit: I've changed it for a more systematic approach, now everything up to eight queens works /Edit: optimized it, there's no solution for nine queens. Which is actually quite obvious https://code.sololearn.com/cPF0SN57La7C/?ref=app
13th Aug 2018, 5:45 PM
Anna
Anna - avatar
0
https://www.google.es/amp/s/www.geeksforgeeks.org/backtracking-set-3-n-queen-problem/amp/
13th Aug 2018, 4:18 PM
Bebida Roja
Bebida Roja - avatar