





UpperCAmelCase__    :      Union[str, Any]       					=[
    [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:
				return 0 <= row < rows and 0 <= col < cols





def   _lowercase       (    _UpperCAmelCase      ,   _UpperCAmelCase      ,   _UpperCAmelCase      ,   _UpperCAmelCase					)    ->	int:
				lowerCamelCase									=len(_UpperCAmelCase					)
				lowerCamelCase									=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:
				lowerCamelCase									=set()

				lowerCamelCase									=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
																lowerCamelCase									=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()












def   _lowercase       (    _UpperCAmelCase					)    ->	bool:
				if not isinstance(_UpperCAmelCase      ,   _UpperCAmelCase					):
								lowerCamelCase									=F"""Input value of [number={number}] must be an integer"""
								raise TypeError(_UpperCAmelCase					)
				if number < 0 or number % 2 == 1:
								return False
				lowerCamelCase									=int(number**0.5					)
				return number == number_sqrt * (number_sqrt + 1)


if __name__ == "__main__":
							import doctest

							doctest.testmod()





