A cool algorithm to check a Sudoku field?

前端 未结 25 1292
清酒与你
清酒与你 2021-01-30 09:19

Does anyone know a simple algorithm to check if a Sudoku-Configuration is valid? The simplest algorithm I came up with is (for a board of size n) in Pseudocode

f         


        
25条回答
  •  南笙
    南笙 (楼主)
    2021-01-30 09:48

    Just a thought: don't you need to also check the numbers in each 3x3 square?

    I'm trying to figure out if it is possible to have the rows and columns conditions satisfied without having a correct sudoku

提交回复
热议问题