Skip to content

Conversation

@kkhevna9252
Copy link

No description provided.

@super30admin
Copy link
Owner

Your solution for N-Queens is excellent. It correctly implements the backtracking algorithm with proper validation checks. The code is clean and well-commented. Here are a few minor suggestions:

  • In the isValid function, you reassign the parameters i and j to row and col. While this works, it might be clearer to declare new variables directly (e.g., var r = i and var c = j) without modifying the parameters. Alternatively, you can use val for the parameters since they are not meant to be changed.
  • Consider adding more comments within the helper functions to explain the steps, especially for learners who might be new to backtracking.
  • The solution for WordSearch was included in the same submission, but the problem only asked for N-Queens. In the future, make sure to submit only the required solution unless otherwise specified.

Overall, great job!

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.

3 participants