


_snake_case				=			[
    [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 	A (		A__		,		A__		,		A__		,		A__			):
     return 0 <= row < rows and 0 <= col < cols







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







def 	A (		A__			):
     UpperCAmelCase    :					set			=      set()

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


if __name__ == "__main__":
      import doctest

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







from __future__ import annotations







def 	A (		A__		,		A__		,		A__		,		A__			):

     # Base Case
     if counter == 0 or capacity == 0:
          return 0

     # If weight of the nth item is more than Knapsack of capacity,
     #   then this item cannot be included in the optimal solution,
     # else return the maximum of two cases:
     #   (1) nth item included
     #   (2) not included
     if weights[counter - 1] > capacity:
          return knapsack(A__		,		A__		,		A__		,		counter - 1			)
     else:
          UpperCAmelCase    :					List[str]			=      capacity - weights[counter - 1]
          UpperCAmelCase    :					Tuple			=      values[counter - 1] + knapsack(
              A__		,		A__		,		A__		,		counter - 1			)
          UpperCAmelCase    :					Optional[int]			=      knapsack(A__		,		A__		,		A__		,		counter - 1			)
          return max(A__		,		A__			)


if __name__ == "__main__":
      import doctest

      doctest.testmod()



