Skip to content

Conversation

@Gandhi9381
Copy link

Your isSafe lambda had an unclosed bracket and an extra n parameter that wasn’t needed, since n is already accessible from the outer scope.

Before:

function<bool(int, int, int)> isSafe = [&](int x, int y, int n) {
return (x >= 0 && y >= 0 && x < n && y < n && board[x][y] == -1);
fix the code
};

After:

auto isSafe = [&](int x, int y) -> bool {
return (x >= 0 && y >= 0 && x < n && y < n && board[x][y] == -1);
};

Sign up for free to 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.

1 participant