input: Write a function to solve a maze using an object-oriented structure in Python. Implement a `Maze` class with a method `solve_maze` that returns the shortest path from the start to the end of the maze. If the maze cannot be solved, the method should return an empty list. The maze is represented as a 2D grid where cells with a value of 1 represent paths and cells with a value of 0 represent walls.
  
  
  class Maze:
      def __init__(self, n, m):
          self._n, self._m = n, m
          self._grid = [[0] * m for _ in range(n)]  # Initialize with walls
  
      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
          return []
  
      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:
              return
  
          self._grid[i][j] = 0  # Mark as visited
          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
  
  # Test cases
  assert Maze(3, 3)._grid == [[0, 0, 0], [0, 0, 0], [0, 0, 0]]  # Default grid with walls
  assert Maze(2, 2).solve_maze() == []  # Unsolvable maze (only walls)
  # Add more test cases to validate the implementation
  
output: 
  def solve_maze(self):
      from collections import deque
      start, end = (0, 0), (self._n-1, self._m-1)
      queue = deque([(start, [])])
      visited = set()
  
      while queue:
          (current_x, current_y), path = queue.popleft()
          if (current_x, current_y) == end:
              return path + [(current_x, current_y)]
          if (current_x, current_y) in visited:
              continue
          visited.add((current_x, current_y))
  
          for dx, dy in [(-1, 0), (1, 0), (0, -1), (0, 1)]:
              new_x, new_y = current_x + dx, current_y + dy
              if 0 <= new_x < self._n and 0 <= new_y < self._m and self._grid[new_x][new_y] == 1:
                  queue.append(((new_x, new_y), path + [(current_x, current_y)]))
  
      return []
  