Skip to content

Commit 0fc3e09

Browse files
committed
Fixed formatting issues
1 parent 0761aa5 commit 0fc3e09

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/main/java/com/thealgorithms/backtracking/NQueens.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ public static void placeQueens(final int queens) {
6363
List<List<String>> arrangements = new ArrayList<>();
6464
getSolution(queens, arrangements, new int[queens], 0);
6565
if (arrangements.isEmpty()) {
66-
System.out.println("There is no way to place " + queens + " queens on board of size "
67-
+ queens + "x" + queens);
66+
System.out.println(
67+
"There is no way to place " + queens + " queens on board of size " + queens + "x" + queens);
6868
} else {
6969
System.out.println("Arrangement for placing " + queens + " queens");
7070
}
@@ -102,9 +102,9 @@ private static void getSolution(int boardSize, List<List<String>> solutions, int
102102
columns[columnIndex] = rowIndex;
103103

104104
// Skip current position if row or diagonal is already occupied
105-
if (OCCUPIED_ROWS.contains(rowIndex)
106-
|| OCCUPIED_DIAGONALS.contains(rowIndex - columnIndex)
107-
|| OCCUPIED_ANTI_DIAGONALS.contains(rowIndex + columnIndex)) {
105+
if (OCCUPIED_ROWS.contains(rowIndex) ||
106+
OCCUPIED_DIAGONALS.contains(rowIndex - columnIndex) ||
107+
OCCUPIED_ANTI_DIAGONALS.contains(rowIndex + columnIndex)) {
108108
continue;
109109
}
110110

0 commit comments

Comments
 (0)