


__SCREAMING_SNAKE_CASE	:							str           =  [
    [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 		snake_case_   (				lowercase__     :    int       ,     lowercase__     :    int       ,     lowercase__     :    int       ,     lowercase__     :    int     ):






				'''simple docstring'''






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

def 		snake_case_   (				lowercase__     :    int       ,     lowercase__     :    int       ,     lowercase__     :    set       ,     lowercase__     :    list[list[int]]     ):






				'''simple docstring'''






				_lowerCAmelCase  						=len(lowercase__     )
				_lowerCAmelCase  						=len(mat[0]     )
				if is_safe(lowercase__       ,     lowercase__       ,     lowercase__       ,     lowercase__     ) and (row, col) not in seen and mat[row][col] == 1:
								seen.add((row, col)     )
								return (
								    1
								    + depth_first_search(row + 1       ,     lowercase__       ,     lowercase__       ,     lowercase__     )
								    + depth_first_search(row - 1       ,     lowercase__       ,     lowercase__       ,     lowercase__     )
								    + depth_first_search(lowercase__       ,     col + 1       ,     lowercase__       ,     lowercase__     )
								    + depth_first_search(lowercase__       ,     col - 1       ,     lowercase__       ,     lowercase__     )
								)
				else:
								return 0

def 		snake_case_   (				lowercase__     :    list[list[int]]     ):






				'''simple docstring'''






				_lowerCAmelCase  						=set()

				_lowerCAmelCase  						=0
				for row, line in enumerate(lowercase__     ):
								for col, item in enumerate(lowercase__     ):
												if item == 1 and (row, col) not in seen:
																# Maximizing the area
																_lowerCAmelCase  						=max(lowercase__       ,     depth_first_search(lowercase__       ,     lowercase__       ,     lowercase__       ,     lowercase__     )     )
				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


__SCREAMING_SNAKE_CASE	:							Optional[int]           =  {'''configuration_sew_d''': ['''SEW_D_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''SEWDConfig''']}

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		__SCREAMING_SNAKE_CASE	:							Dict           =  [
		    '''SEW_D_PRETRAINED_MODEL_ARCHIVE_LIST''',
		    '''SEWDForCTC''',
		    '''SEWDForSequenceClassification''',
		    '''SEWDModel''',
		    '''SEWDPreTrainedModel''',
		]

if TYPE_CHECKING:
		from .configuration_sew_d import SEW_D_PRETRAINED_CONFIG_ARCHIVE_MAP, SEWDConfig

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_sew_d import (
				    SEW_D_PRETRAINED_MODEL_ARCHIVE_LIST,
				    SEWDForCTC,
				    SEWDForSequenceClassification,
				    SEWDModel,
				    SEWDPreTrainedModel,
				)


else:
		import sys

		__SCREAMING_SNAKE_CASE	:							Tuple           =  _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)

