Skip to content
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

add(sudoku.go): implement SolveSudoku with optimized backtracking #58

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bensaine
Copy link

Pull Request: Implement SolveSudoku Function with Optimized Backtracking

Overview

This pull request adds the SolveSudoku function to solve a Sudoku grid efficiently using backtracking. Additionally, the implementation incorporates techniques such as naked singles and hidden singles to reduce the number of recursive calls, improving overall performance.

Changes Made

  • Implemented the SolveSudoku function in sudoku.go.
  • Utilized backtracking to explore possible solutions and backtrack when necessary.
  • Integrated naked singles and hidden singles calculations to optimize the solving process, and reduce the number of recursive steps needed. This drastically improves performance, especially for easy puzzles.
  • Added relevant comments for clarity.

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