1887

Jav G-queen [VALIDATED ◎]

private void backtrack(List<List<String>> result, char[][] board, int row) { if (row == board.length) { List<String> solution = new ArrayList<>(); for (char[] chars : board) { solution.add(new String(chars)); } result.add(solution); return; } for (int col = 0; col < board.length; col++) { if (isValid(board, row, col)) { board[row][col] = 'Q'; backtrack(result, board, row + 1); board[row][col] = '.'; } } }

This is a required field
Please enter a valid email address
Approval was a Success
Invalid data
An Error Occurred
Approval was partially successful, following selected items could not be processed due to error