I'm trying to write an algorithm that finds the number of solutions in a given partially filled in Sudoku board. i.e. given
"1 6 4 0 0 0 0 0 2",
"2 0 0 4 0 3 9 1 0",
"0 0 5 0 8 0 4 0 7",
"0 9 0 0 0 6 5 0 0",
"5 0 0 1 0 2 0 0 8",
"0 0 8 9 0 0 0 3 0",
"8 0 9 0 4 0 2 0 0",
"0 7 3 5 0 9 0 0 1",
"4 0 0 0 0 0 6 7 9"
where 0s represent blank spots. I want to create 3 separate arrays of sets, one for each set of numbers in each column, row, and 3x3 square. I am trying the declaration:
horizontal = new HashSet<Integer>[9];
Where private HashSet[] horizontal is declared earlier, but this doesn't work. What is the correct declaration or can I not make declare an array of Sets?