input: Write a python function to generate a maze using the depth-first search algorithm.
  assert len(generate_maze(5, 5)) == 6
  assert generate_maze(1, 1) == [[0, 1], [1, 1]]
  assert generate_maze(3, 3)[0][0] == 0
output: def generate_maze(width, height):
      import random
  
      # Define the maze as a 2D array filled with walls
      maze = [[1 for _ in range(width * 2 + 1)] for _ in range(height * 2 + 1)]
  
      def carve_passages(cx, cy):
          directions = [(2, 0), (-2, 0), (0, 2), (0, -2)]
          random.shuffle(directions)
  
          for (dx, dy) in directions:
              nx, ny = cx + dx, cy + dy
              if 0 <= nx < width * 2 and 0 <= ny < height * 2 and maze[ny][nx] == 1:
                  maze[cy + dy // 2][cx + dx // 2] = 0
                  maze[ny][nx] = 0
                  carve_passages(nx, ny)
  
      # Start carving passages from the top-left corner
      start_x, start_y = 1, 1
      maze[start_y][start_x] = 0
      carve_passages(start_x, start_y)
  
      # Add entry and exit points
      maze[0][1] = 0
      maze[height * 2][width * 2 - 1] = 0
  
      return maze