


_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 		_UpperCAmelCase							(     SCREAMING_SNAKE_CASE__     :   int     ,	SCREAMING_SNAKE_CASE__     :   int     ,	SCREAMING_SNAKE_CASE__     :   int     ,	SCREAMING_SNAKE_CASE__     :   int							):
     return 0 <= row < rows and 0 <= col < cols

def 		_UpperCAmelCase							(     SCREAMING_SNAKE_CASE__     :   int     ,	SCREAMING_SNAKE_CASE__     :   int     ,	SCREAMING_SNAKE_CASE__     :   set     ,	SCREAMING_SNAKE_CASE__     :   list[list[int]]							):
     __UpperCamelCase       				=len(SCREAMING_SNAKE_CASE__							)
     __UpperCamelCase       				=len(mat[0]							)
     if is_safe(SCREAMING_SNAKE_CASE__     ,	SCREAMING_SNAKE_CASE__     ,	SCREAMING_SNAKE_CASE__     ,	SCREAMING_SNAKE_CASE__							) and (row, col) not in seen and mat[row][col] == 1:
          seen.add((row, col)							)
          return (
              1
              + depth_first_search(row + 1     ,	SCREAMING_SNAKE_CASE__     ,	SCREAMING_SNAKE_CASE__     ,	SCREAMING_SNAKE_CASE__							)
              + depth_first_search(row - 1     ,	SCREAMING_SNAKE_CASE__     ,	SCREAMING_SNAKE_CASE__     ,	SCREAMING_SNAKE_CASE__							)
              + depth_first_search(SCREAMING_SNAKE_CASE__     ,	col + 1     ,	SCREAMING_SNAKE_CASE__     ,	SCREAMING_SNAKE_CASE__							)
              + depth_first_search(SCREAMING_SNAKE_CASE__     ,	col - 1     ,	SCREAMING_SNAKE_CASE__     ,	SCREAMING_SNAKE_CASE__							)
          )
     else:
          return 0

def 		_UpperCAmelCase							(     SCREAMING_SNAKE_CASE__     :   list[list[int]]							):
     __UpperCamelCase       				=set()

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


if __name__ == "__main__":
   import doctest

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









def 		_UpperCAmelCase							(     SCREAMING_SNAKE_CASE__     :   Union[str, Any]     ,	SCREAMING_SNAKE_CASE__     :   int							):
     if n < 0:
          return 0
     # table[i] represents the number of ways to get to amount i
     __UpperCamelCase       				=[0] * (n + 1)

     # There is exactly 1 way to get to zero(You pick no coins).
     __UpperCamelCase       				=1

     # Pick all coins one by one and update table[] values
     # after the index greater than or equal to the value of the
     # picked coin
     for coin_val in s:
          for j in range(SCREAMING_SNAKE_CASE__     ,	n + 1							):
               table[j] += table[j - coin_val]

     return table[n]


if __name__ == "__main__":
   import doctest

   doctest.testmod()





