input: Write a function to create an object-oriented structure that solves a maze using Python. The function should define a class named Maze with an initialization method to set up the maze dimensions and a method to solve the maze using a recursive approach. The function should return a list of values representing the path taken in solving the maze. If the maze is unsolvable, the function should return an empty list.
  
  
  class Maze:
      def __init__(self, n, m):
          self._n, self._m = n, m
          self._grid = [[None] * m for _ in range(n)]
  
      def solve_maze(self):
          result, found = [], False
          start, end = (0, 0), (self._n-1, self._m-1)
  
          for i in range(self._n):
              for j in range(self._m):
                  if self._grid[i][j] == 1:
                      value = 0
                      self._find_omega(i, j, value, result, start, end,
                                       found)
                      return result
  
      def _find_omega(self, i, j, value,
                      result, start, end, found):
          rowNbr, colNbr = [-1, 0, 0, 1], [0, -1, 1, 0]
  
          if (i, j) == end:
              found = True
              result.append(value)
              return
  
          if found == True:
              return
  
          self._grid[i][j] = 0
          for k in range(4):
              if self._on_board(i + rowNbr[k], j + colNbr[k]):
                  self._find_omega(i + rowNbr[k], j + colNbr[k],
                                   value + 1, result,
                                   start, end, found)
  
      def _on_board(self, i, j):
          return 0 <= i < self._n and 0 <= j < self._m and self._grid[i][j] == 1
  
  
  assert Maze(5, 5).solve_maze() == [1, 2, 3, 4, 5]
  assert Maze(3, 3).solve_maze() == []
  assert Maze(2, 4).solve_maze() == [1, 2, 3]
  assert Maze(1, 4).solve_maze() == [1, 2, 3, 4]
  assert Maze(0, 0).solve_maze() == []
output: 
  class Maze:
      def __init__(self, n, m):
          self._n, self._m = n, m
          self._grid = [[1] * m for _ in range(n)]
  
      def solve_maze(self):
          result = []
          if self._solve_maze_recursive(0, 0, 0, result):
              return result
          return []
  
      def _solve_maze_recursive(self, x, y, step, result):
          if x == self._n - 1 and y == self._m - 1:
              result.append(step + 1)
              return True
  
          if self._is_valid_move(x, y):
              result.append(step + 1)
              self._grid[x][y] = 0
  
              if self._solve_maze_recursive(x + 1, y, step + 1, result):
                  return True
              if self._solve_maze_recursive(x, y + 1, step + 1, result):
                  return True
              if self._solve_maze_recursive(x - 1, y, step + 1, result):
                  return True
              if self._solve_maze_recursive(x, y - 1, step + 1, result):
                  return True
  
              result.pop()
              self._grid[x][y] = 1
  
          return False
  
      def _is_valid_move(self, x, y):
          return 0 <= x < self._n and 0 <= y < self._m and self._grid[x][y] == 1
  