google foobar challenge error with dfs solution
<p>I received the invite to attened google code challenge. I got a problem like find the minimun path in the maze while you are allow to remove at most one wall. I submit my code and only got <code>400 bad request</code>. I am a bit confused about this because I do not know it is the issue with my code or not. Below is my code, it may risk high time complexity:</p>

<pre><code>public class Answer {   
    public static int answer(int[][] maze) { 

        // Your code goes here.
        boolean[][] visited = new boolean[maze.length][maze[0].length];


        return dfs(0, 0, true, visited, maze, 1);

    } 
    private static int dfs(int x, int y, boolean allowRemove, boolean[][] visited, int[][] maze, int len){
         if(x == maze.length - 1 &amp;&amp; y == maze[0].length - 1){

            return len;
        }

        int[] dx = {0, 0, -1, 1};
        int[] dy = {-1, 1, 0, 0};
        visited[x][y] = true;
        int min = Integer.MAX_VALUE;
        for(int i = 0; i &lt; 4; i++){
           int nx = dx[i] + x;
           int ny = dy[i] + y;
           if(nx &lt; 0 || ny &lt; 0 || nx &gt;= maze.length || ny &gt;= maze[0].length || visited[nx][ny]){
               continue;
           }
           if(maze[nx][ny] == 0){
               min = Math.min(dfs(nx, ny, allowRemove, visited, maze, len + 1), min);

           }else if(allowRemove){
                min = Math.min(dfs(nx, ny, false, visited, maze, len + 1),min);

           }
          if(min == maze.length + maze[0].length - 1){
              break;
          }
        }
        visited[x][y] = false;
        return min;
    }
}
</code></pre>