What is the most efficient way to make a sudoku solver?

Hello! I am trying to make a sudoku solver and the title pretty much says it all, but I’ve never really seen an answer that satisfies me.

The only way I can really think of sort of relies on brute-force by checking numbers 1-9 for every cell and if any of those numbers work (as in they don’t appear in the same box, column or row) then we can move onto the next cell, but if none of the numbers work, then we repeat the whole process until it is fully solved.

But this can be quite memory intensive and I was wondering if there is a better solution.

1 Like