input: 
  from typing import List
  
  class Maze:
      def solve_maze(self, grid: List[List[int]], n: int, m: int) -> List[int]:
          """ Solve a maze represented by a 2D grid where 1s represent open paths and 0s represent walls.
          The maze starts at the top-left corner (0, 0) and ends at the bottom-right corner (n-1, m-1).
          The function should return the path length from start to end if a path exists, otherwise it should return an empty list.
          >>> maze = Maze()
          >>> maze.solve_maze([[1, 0, 0], [1, 1, 0], [0, 1, 1]], 3, 3)
          [5]
          >>> maze.solve_maze([[1, 0, 0], [1, 0, 0], [0, 0, 1]], 3, 3)
          []
          """
          result, found = [], False
          start, end = (0, 0), (n-1, m-1)
  
          def _find_omega(i, j, value):
              nonlocal found
              rowNbr, colNbr = [-1, 0, 0, 1], [0, -1, 1, 0]
  
              if (i, j) == end:
                  found = True
                  result.append(value)
                  return
  
              if found:
                  return
  
              grid[i][j] = 0
              for k in range(4):
                  if _on_board(i + rowNbr[k], j + colNbr[k]):
                      _find_omega(i + rowNbr[k], j + colNbr[k], value + 1)
  
          def _on_board(i, j):
              return 0 <= i < n and 0 <= j < m and grid[i][j] == 1
  
          _find_omega(0, 0, 0)
          return result
  
output:     
          if not found:
              return []
          return result
  