


__a   				=      [
    [0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0],
    [0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0],
    [0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0],
]




def 			__lowercase	(						_UpperCamelCase,    _UpperCamelCase,    _UpperCamelCase,    _UpperCamelCase     )    ->bool:







      """simple docstring"""

      return 0 <= row < rows and 0 <= col < cols




def 			__lowercase	(						_UpperCamelCase,    _UpperCamelCase,    _UpperCamelCase,    _UpperCamelCase     )    ->int:







      """simple docstring"""

      lowercase			:   Optional[int]					   =		len(_UpperCamelCase     )
      lowercase			:   str					   =		len(mat[0]     )
      if is_safe(_UpperCamelCase,    _UpperCamelCase,    _UpperCamelCase,    _UpperCamelCase     ) and (row, col) not in seen and mat[row][col] == 1:
            seen.add((row, col)     )
            return (
                1
                + depth_first_search(row + 1,    _UpperCamelCase,    _UpperCamelCase,    _UpperCamelCase     )
                + depth_first_search(row - 1,    _UpperCamelCase,    _UpperCamelCase,    _UpperCamelCase     )
                + depth_first_search(_UpperCamelCase,    col + 1,    _UpperCamelCase,    _UpperCamelCase     )
                + depth_first_search(_UpperCamelCase,    col - 1,    _UpperCamelCase,    _UpperCamelCase     )
            )
      else:
            return 0




def 			__lowercase	(						_UpperCamelCase     )    ->int:







      """simple docstring"""

      lowercase			:   set					   =		set()

      lowercase			:   Tuple					   =		0
      for row, line in enumerate(_UpperCamelCase     ):
            for col, item in enumerate(_UpperCamelCase     ):
                  if item == 1 and (row, col) not in seen:
                        # Maximizing the area
                        lowercase			:   Tuple					   =		max(_UpperCamelCase,    depth_first_search(_UpperCamelCase,    _UpperCamelCase,    _UpperCamelCase,    _UpperCamelCase     )     )
      return max_area


if __name__ == "__main__":
  import doctest

  print(find_max_area(matrix))  # Output -> 6
  doctest.testmod()





from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


__a   				=      {
    '''configuration_decision_transformer''': [
        '''DECISION_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''DecisionTransformerConfig''',
    ],
}

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  __a   				=      [
      '''DECISION_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST''',
      '''DecisionTransformerGPT2Model''',
      '''DecisionTransformerGPT2PreTrainedModel''',
      '''DecisionTransformerModel''',
      '''DecisionTransformerPreTrainedModel''',
  ]


if TYPE_CHECKING:
  from .configuration_decision_transformer import (
      DECISION_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
      DecisionTransformerConfig,
  )

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_decision_transformer import (
        DECISION_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
        DecisionTransformerGPTaModel,
        DecisionTransformerGPTaPreTrainedModel,
        DecisionTransformerModel,
        DecisionTransformerPreTrainedModel,
    )


else:
  import sys

  __a   				=      _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)

