N-queens problem: Difference between revisions
m
→Python: Niklaus Wirth algorithm: Removed redundant (duplicate) example.
m (→Python: Niklaus Wirth algorithm: Added a more optimized version.) |
m (→Python: Niklaus Wirth algorithm: Removed redundant (duplicate) example.) |
||
Line 12,841:
for solution in queens(8, 0, [], [], []):
print(solution)</syntaxhighlight>
The algorithm can be
<syntaxhighlight lang="python">def queens(n: int):
|