input: from typing import List
  
  def solve_maze_path(maze: List[List[int]]) -> List[int]:
      """ Given a 2D list representing a maze, where 1 represents a valid path and 0 represents a wall, 
      solve the maze to find the shortest path from the top-left corner to the bottom-right corner.
      Return a list of integers representing the number of steps to reach each position in the path.
      If no path is found, return an empty list.
      
      >>> solve_maze_path([[1, 0, 0], [1, 1, 0], [0, 1, 1]])
      [0, 1, 2, 3]
      >>> solve_maze_path([[1, 0, 0], [1, 0, 0], [0, 0, 1]])
      []
      """
      n, m = len(maze), len(maze[0])
      result, found = [], False
      start, end = (0, 0), (n-1, m-1)
  
      def _find_omega(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
  
          maze[i][j] = 0
          result.append(value)
          for k in range(4):
              if _on_board(i + rowNbr[k], j + colNbr[k]):
                  _find_omega(i + rowNbr[k], j + colNbr[k], value + 1, result, start, end, found)
  
      def _on_board(i, j):
          return 0 <= i < n and 0 <= j < m and maze[i][j] == 1
  
      _find_omega(start[0], start[1], 0, result, start, end, found)
      return result if found else []
output:     
      n, m = len(maze), len(maze[0])
      result, found = [], False
      start, end = (0, 0), (n-1, m-1)
  
      def _find_omega(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
  
          maze[i][j] = 0
          result.append(value)
          for k in range(4):
              if _on_board(i + rowNbr[k], j + colNbr[k]):
                  _find_omega(i + rowNbr[k], j + colNbr[k], value + 1, result, start, end, found)
  
      def _on_board(i, j):
          return 0 <= i < n and 0 <= j < m and maze[i][j] == 1
  
      _find_omega(start[0], start[1], 0, result, start, end, found)
      return result if found else []
  