input: Write a python function to solve a maze, where the maze is represented as a grid of 0s and 1s, with 1s indicating paths and 0s indicating walls. Use the provided Maze class to find the shortest path from the top-left corner to the bottom-right corner.
  assert Maze(3, 3)._grid == [[None, None, None], [None, None, None], [None, None, None]]
  assert Maze(3, 3).solve_maze() == []
output: def solve_maze(self):
      from collections import deque
  
      def is_valid(x, y):
          return 0 <= x < self._rows and 0 <= y < self._cols and self._grid[x][y] == 1
      
      directions = [(0, 1), (1, 0), (0, -1), (-1, 0)]
      queue = deque([((0, 0), [(0, 0)])])
      visited = set((0, 0))
  
      while queue:
          (x, y), path = queue.popleft()
          if (x, y) == (self._rows - 1, self._cols - 1):
              return path
          
          for dx, dy in directions:
              nx, ny = x + dx, y + dy
              if is_valid(nx, ny) and (nx, ny) not in visited:
                  visited.add((nx, ny))
                  queue.append(((nx, ny), path + [(nx, ny)]))
      
      return []
  
  class Maze:
      def __init__(self, rows, cols):
          self._rows = rows
          self._cols = cols
          self._grid = [[None for _ in range(cols)] for _ in range(rows)]
      
      solve_maze = solve_maze