input: from typing import List
  
  class Maze:
      def solve_maze(self, grid: List[List[int]]) -> List[int]:
          """
          Solve a maze using an object-oriented structure. The maze is represented
          as a 2D list of integers where '1' represents a path and '0' represents a wall.
          The goal is to find a path from the top-left corner (0, 0) to the bottom-right
          corner (n-1, m-1) and return the path length. If no path is found, return an empty list.
          
          Example:
          >>> maze = Maze()
          >>> maze.solve_maze([[1, 0, 0], [1, 1, 0], [0, 1, 1]])
          [4]
          >>> maze.solve_maze([[1, 0, 0], [1, 0, 0], [0, 0, 1]])
          []
          """
          self._n, self._m = len(grid), len(grid[0])
          self._grid = grid
          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:
              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
output:     
          if not result:
              return []
          return [min(result)]
  