Question: JAVA Problem: Given a maze represented by a character matrix filled with '#'s and '.'s determine whether or not it is possible to start from
JAVA
Problem: Given a maze represented by a character matrix filled with '#'s and '.'s determine whether or not it is possible to start from the top left position (0,0) and get to the bottom right position (mat.length-1, mat[0].length-1). You can move through the maze by going up, down, left, or right. You may not move diagonally. You may not move through walls (represented by '#'). You may freely move through '.'
You can use a helper method to assist in solving this problem. If it is possible to get through the maze, return "yes". If it is not possible to get through the maze, return "no". This problem is a very common contest problem type.
Data: Mazes will all be 3 X 3 and will not be empty nor null.
Output: Return yes or no. Sample Data [['.','#','#'],['.','.','.'],['#','.','.']] [['.','#','#'],['#','#','#'],['#','.','.']]
Sample Output yes no
**PLEASE USE THIS FORMAT**
String go(char[][] mat) { // your code goes here }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
