In Java Suppose you want to implement a Sudoku game that con
In Java: Suppose you want to implement a Sudoku game that consists of 9x9 rows and columns of squares. Which layout would be the best one to use and why?
Solution
Using a 2D array would be the best data structure to implement sudoku.
Why?
1. All row and column level operation like findDuplicateInRow, findDuplicateInColumn would have constant complexity.
2. Searching is pretty easy.
3. Operations related to findingDuplicateInSquare can be implemented by finding the square and checking for all the cells of that square.

