Please copy and paste the code and explain why it won't work. It is supposed to take a maze and return the exits and number of exits. import java.util.Scanner; import java.io.File; import java.io.FileNotFoundException; import java.util.ArrayList; import java.util.Arrays; public class MazeSolver { int numRows; int numCols; int startRow; int startCol; int rows; int col; public static void loadMaze(){ int numRows; int numCols; int startRow; int startCol; int rows; int col; try{ Scanner input = new Scanner(System.in); System.out.println("Please enter file name:"); String filename = input.nextLine(); File file = new File(filename); Scanner fileInput = new Scanner(file); numRows = fileInput.nextInt(); numCols = fileInput.nextInt(); ArrayList column= new ArrayList<String>(); ArrayList row = new ArrayList<String>(); char[][] maze= new char[numRows][numCols]; //for the row, get array start row and column index for (int i = 0; i < numRows; i++) { String line = fileInput.next(); for (int j = 0; j < numCols; j++) { char empt = ' '; maze[i][j] = if (maze[i][j] == empt){ startRow = i; startCol = j; System.out.println(i); //solveMaze(maze[i][j]); } else{ return; } } } fileInput.close(); } catch(FileNotFoundException e) { System.out.println("File not found."); loadMaze(); } } // Method to solve the maze public void solveMaze(char[][] maze) { ArrayList<Integer> exitRows = new ArrayList<Integer>(); ArrayList<Integer> exitCols = new ArrayList<Integer>(); boolean[][] visited = new boolean[numRows][numCols]; // Call recursive method to explore the maze exploreMaze(startRow, startCol, visited, maze, exitRows, exitCols); // Print number of exits found System.out.println("Number of exits found: " + exitRows.size()); // Print positions of exits for (int i = 0; i < exitRows.size(); i++) { System.out.println("Exit found at: (" + exitRows.get(i) + ", " + exitCols.get(i) + ")"); } } public void exploreMaze(int row, int col, boolean[][] visited, char[][] maze, ArrayList<Integer> exitRows, ArrayList<Integer> exitCols) { // Recursive method to explore the maze if (row < 0 || col < 0 || row >= numRows || col >= numCols || visited[row][col]) { // Base case: if current position is out of bounds or already visited return; } // Base case: if current position is an exit if (maze[row][col] == 'E'){ exitRows.add(row); exitCols.add(col); return; } // Mark current position as visited visited[row][col] = true; exploreMaze(row-1, col, visited, maze,exitRows, exitCols); // up exploreMaze(row, col+1, visited, maze,exitRows, exitCols); // right exploreMaze(row+1, col, visited, maze,exitRows, exitCols); // down exploreMaze(row, col-1, visited, maze,exitRows, exitCols); // left // Recursively explore neighboring positions } } .