-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing File N-queen.py #7299
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
class Solution:
def solveNQueens(self, n: int):
def is_safe(board, row, col):
# Check if there is a queen in the same column
for i in range(row):
if board[i][col] == 'Q':
return False
Get user input for N
n = int(input("Enter the value of N: "))
solution = Solution()
solutions = solution.solveNQueens(n)
Display solutions
for sol in solutions:
for row in sol:
print(row)
print()
This is missing
The text was updated successfully, but these errors were encountered: