input: Write a function to create an object-oriented structure to solve a maze using Python. The Maze class should be initialized with the dimensions of the maze (n, m) and should have methods to solve the maze using a recursive DFS traversal. The solve_maze method should return the path length if the end is reached, otherwise it should return an empty list. The _find_omega method should be a helper method to perform the DFS traversal. The _on_board method should check if a cell is within the bounds of the maze and is a valid path cell.
  assert len(Maze(3, 3).solve_maze()) == 4
  assert len(Maze(2, 2).solve_maze()) == 2
  assert len(Maze(4, 4).solve_maze()) == 7
  assert len(Maze(1, 1).solve_maze()) == 0
  assert len(Maze(0, 0).solve_maze()) == 0
output: 
  def __init__(self, n, m):
      self.n = n
      self.m = m
      self.maze = [[0] * m for _ in range(n)]
      self.directions = [(0, 1), (1, 0), (0, -1), (-1, 0)]
  
  def solve_maze(self):
      return self._find_omega(0, 0)
  
  def _find_omega(self, x, y):
      if x == self.n - 1 and y == self.m - 1:
          return [(x, y)]
      if not self._on_board(x, y):
          return []
      self.maze[x][y] = 1
      for dx, dy in self.directions:
          nx, ny = x + dx, y + dy
          path = self._find_omega(nx, ny)
          if path:
              return [(x, y)] + path
      return []
  
  def _on_board(self, x, y):
      return 0 <= x < self.n and 0 <= y < self.m and self.maze[x][y] == 0
  