Shortest Sudoku Solver in Python - How does it work?

前端 未结 5 1698
情话喂你
情话喂你 2020-12-04 05:04

I was playing around with my own Sudoku solver and was looking for some pointers to good and fast design when I came across this:

def r(a):i=a.find(\'0\');~i         


        
5条回答
  •  难免孤独
    2020-12-04 05:35

    A lot of the short sudoku solvers just recursively try every possible legal number left until they have successfully filled the cells. I haven't taken this apart, but just skimming it, it looks like that's what it does.

提交回复
热议问题