from ..utils import DummyObject, requires_backends





class 							lowercase						(						metaclass=__SCREAMING_SNAKE_CASE ):
   lowerCamelCase_    					=['torch', 'torchsde']


   def __init__(   self				:	Any   ,		*__lowerCAmelCase				:	Union[str, Any]   ,		**__lowerCAmelCase				:	Optional[int])      ->					str:
         requires_backends(self   ,		["torch", "torchsde"])


   @classmethod
   def __UpperCAmelCase       (   cls				:	Optional[int]   ,		*__lowerCAmelCase				:	List[Any]   ,		**__lowerCAmelCase				:	Any)      ->					Tuple:
         requires_backends(cls   ,		["torch", "torchsde"])


   @classmethod
   def __UpperCAmelCase       (   cls				:	List[Any]   ,		*__lowerCAmelCase				:	Tuple   ,		**__lowerCAmelCase				:	Union[str, Any])      ->					Optional[Any]:
         requires_backends(cls   ,		["torch", "torchsde"])







'''simple docstring'''

from __future__ import annotations


def __a (	__lowerCamelCase			:						list[list[int]]				)	->							bool:
      '''simple docstring'''


      lowercase_     =      len(__lowerCamelCase				)
      # We need to create solution object to save path.
      lowercase_     =      [[0 for _ in range(__lowerCamelCase				)] for _ in range(__lowerCamelCase				)]
      lowercase_     =      run_maze(__lowerCamelCase ,		0 ,		0 ,		__lowerCamelCase				)
      if solved:
            print("\n".join(str(__lowerCamelCase				) for row in solutions				)				)
      else:
            print("No solution exists!"				)
      return solved


def __a (	__lowerCamelCase			:						list[list[int]] ,		__lowerCamelCase			:						int ,		__lowerCamelCase			:						int ,		__lowerCamelCase			:						list[list[int]]				)	->							bool:
      '''simple docstring'''


      lowercase_     =      len(__lowerCamelCase				)
      # Final check point.
      if i == j == (size - 1):
            lowercase_     =      1
            return True

      lowercase_     =      (not i < 0) and (not j < 0)  # Check lower bounds
      lowercase_     =      (i < size) and (j < size)  # Check upper bounds

      if lower_flag and upper_flag:
            # check for already visited and block points.
            lowercase_     =      (not solutions[i][j]) and (not maze[i][j])
            if block_flag:
                  # check visited
                  lowercase_     =      1

                  # check for directions
                  if (
                      run_maze(__lowerCamelCase ,		i + 1 ,		__lowerCamelCase ,		__lowerCamelCase				)
                      or run_maze(__lowerCamelCase ,		__lowerCamelCase ,		j + 1 ,		__lowerCamelCase				)
                      or run_maze(__lowerCamelCase ,		i - 1 ,		__lowerCamelCase ,		__lowerCamelCase				)
                      or run_maze(__lowerCamelCase ,		__lowerCamelCase ,		j - 1 ,		__lowerCamelCase				)
                  ):
                        return True

                  lowercase_     =      0
                  return False
      return False


if __name__ == "__main__":
       import doctest

       doctest.testmod()






