input: 
  def solve_maze(n: int, m: int, grid: List[List[int]]) -> List[int]:
      """ Create an object-oriented structure to solve a maze by using python.
      The maze is represented by a grid of integers where 1 represents an open path
      and 0 represents a wall. The function should return the shortest path from
      the top-left corner to the bottom-right corner. If there is no path, it should
      return an empty list.
      >>> solve_maze(3, 3, [[1, 0, 0], [1, 1, 0], [0, 1, 1]])
      [4]
      >>> solve_maze(4, 4, [[1, 0, 0, 0], [1, 1, 0, 0], [0, 1, 1, 0], [0, 0, 1, 1]])
      [6]
      >>> solve_maze(2, 2, [[1, 0], [0, 1]])
      []
      """
      maze = Maze(n, m)
      maze._grid = grid
      return maze.solve_maze()
  
output:     
      class Maze:
          def __init__(self, n, m):
              self.n = n
              self.m = m
              self.grid = None
              self.visited = None
              self.directions = [(0, 1), (1, 0), (0, -1), (-1, 0)]
  
          def solve_maze(self):
              self.visited = [[False] * self.m for _ in range(self.n)]
              path = self._dfs(0, 0, 0)
              return path if path else []
  
          def _dfs(self, x, y, steps):
              if x == self.n - 1 and y == self.m - 1:
                  return [steps]
              self.visited[x][y] = True
              paths = []
              for dx, dy in self.directions:
                  nx, ny = x + dx, y + dy
                  if 0 <= nx < self.n and 0 <= ny < self.m and not self.visited[nx][ny] and self.grid[nx][ny] == 1:
                      path = self._dfs(nx, ny, steps + 1)
                      if path:
                          paths.extend(path)
              self.visited[x][y] = False
              return paths
  