We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2785f97 commit 5a69898Copy full SHA for 5a69898
src/main/java/com/thealgorithms/others/Sudoku.java
@@ -115,15 +115,14 @@ public static boolean solveSudoku(int[][] board, int n) {
115
* @param n The size of the Sudoku board (typically 9 for a standard puzzle).
116
*/
117
public static void print(int[][] board, int n) {
118
- // Print the board in a 9x9 grid format
+ // Print the board in a nxn grid format
119
for (int r = 0; r < n; r++) {
120
for (int d = 0; d < n; d++) {
121
System.out.print(board[r][d]);
122
System.out.print(" ");
123
}
124
System.out.print("\n");
125
126
- // Print a blank line after every 3 rows for readability
127
if ((r + 1) % (int) Math.sqrt(n) == 0) {
128
System.out.print("");
129
0 commit comments