Skip to content

Fix n-queens problem - #12583

Merged
MaximSmolskiy merged 6 commits into
TheAlgorithms:masterfrom
infrablue1:fix-n-queens
Feb 22, 2025
Merged

Fix n-queens problem#12583
MaximSmolskiy merged 6 commits into
TheAlgorithms:masterfrom
infrablue1:fix-n-queens

Conversation

@infrablue1

Copy link
Copy Markdown
Contributor

Describe your change:

Fix wrong solution for n-queens problem which in backtrace folder.

Details

There is an issue about n_queens.py. If I run this script, it will print the wrong result which is different with n_queens_math.py. I think it's enough to check left upper diagonal, right upper diagonal and the same column here. Here are the last few lines of the correct output with my changes:

....... Q
... Q ....
Q ......... Q .......... Q ... Q ............ Q ..... Q ...
The total number of solutions are: 92

@algorithms-keeperalgorithms-keeperBot added tests are failing Do not merge until tests pass and removed tests are failing Do not merge until tests pass labels Feb 18, 2025
@algorithms-keeperalgorithms-keeperBot added awaiting reviews This PR is ready to be reviewed tests are failing Do not merge until tests pass labels Feb 20, 2025
@algorithms-keeperalgorithms-keeperBot removed the awaiting reviews This PR is ready to be reviewed label Feb 20, 2025
@MaximSmolskiy

Copy link
Copy Markdown
Member

@cclauss Can we do something about this?

The job was not started because recent account payments have failed or your spending limit needs to be increased. Please check the 'Billing & plans' section in your settings.

@algorithms-keeperalgorithms-keeperBot removed the tests are failing Do not merge until tests pass label Feb 22, 2025
@MaximSmolskiyMaximSmolskiy changed the title Fix n-queues problemFix n-queens problemFeb 22, 2025
@MaximSmolskiy
MaximSmolskiy merged commit 183fa06 into TheAlgorithms:masterFeb 22, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@infrablue1@MaximSmolskiy@anandfresh@rahmani3101