O'Reilly logo

Joe Celko's Thinking in Sets: Auxiliary, Temporal, and Virtual Tables in SQL by Joe Celko

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

18.2. Two Approaches to Sudoku

Sudoku, the current puzzle fad, started in the United States in 1979 in Games magazine, then caught on in Japan in 1986 and became an international fad in 2005. Most newspapers today carry a daily Sudoku. You start with a nine-by-nine grid that is further divided into nine three-by-three regions. Some of the cells will hold a digit from 1 to 9 in them at the start of the puzzle. Your goal is to fill in all the cells with more digits, such that each row, column, and region contains one and only one instance of each digit.

There are two general approaches to the puzzle. One is to assume that you have a grid with all possible digits in each cell, and then remove the digits that we know cannot be there. The second approach ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required