input: Write a function to determine if an object-oriented structure can solve a maze using Python by implementing the given Maze class with specified methods. If it can solve the maze, return True; else, return False. If the input is empty, return True.
  assert maze_solution([[1, 0, 0, 0], [1, 1, 0, 1], [0, 1, 0, 0], [1, 1, 1, 1]])==True
  assert maze_solution([[1, 0, 0, 0], [1, 1, 0, 1], [0, 0, 0, 0], [1, 1, 1, 1]])==False
  assert maze_solution([[1, 1], [1, 1]])==True
  assert maze_solution([[1, 0], [0, 1]])==False
  assert maze_solution([])==True
output: def maze_solution(maze):
      if not maze:
          return True
      
      def is_valid(x, y):
          return 0 <= x < len(maze) and 0 <= y < len(maze[0]) and maze[x][y] == 1
      
      def solve_maze(x, y):
          if x == len(maze) - 1 and y == len(maze[0]) - 1:
              return True
          if is_valid(x, y):
              maze[x][y] = -1
              if solve_maze(x + 1, y) or solve_maze(x, y + 1) or solve_maze(x - 1, y) or solve_maze(x, y - 1):
                  return True
              maze[x][y] = 1
          return False
      
      return solve_maze(0, 0)