chevron_leftRecursion & Backtracking All topics

Backtracking

6 queens · none may attack another

012345
0
1
2
3
4
5

Place 6 queens on a 6×6 board so no two share a row, a column, or a diagonal. One queen per row — the only question is which column.

step 01/255

  • comparing
  • moving
  • in final place
  • found it
  • ruled out

Practice

spec · json ↗