matrix.max_area_of_island ========================= .. py:module:: matrix.max_area_of_island .. autoapi-nested-parse:: Given an two dimensional binary matrix grid. An island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) You may assume all four edges of the grid are surrounded by water. The area of an island is the number of cells with a value 1 in the island. Return the maximum area of an island in a grid. If there is no island, return 0. Attributes ---------- .. autoapisummary:: matrix.max_area_of_island.matrix Functions --------- .. autoapisummary:: matrix.max_area_of_island.depth_first_search matrix.max_area_of_island.find_max_area matrix.max_area_of_island.is_safe Module Contents --------------- .. py:function:: depth_first_search(row: int, col: int, seen: set, mat: list[list[int]]) -> int Returns the current area of the island >>> depth_first_search(0, 0, set(), matrix) 0 .. py:function:: find_max_area(mat: list[list[int]]) -> int Finds the area of all islands and returns the maximum area. >>> find_max_area(matrix) 6 .. py:function:: is_safe(row: int, col: int, rows: int, cols: int) -> bool Checking whether coordinate (row, col) is valid or not. >>> is_safe(0, 0, 5, 5) True >>> is_safe(-1,-1, 5, 5) False .. py:data:: matrix :value: [[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,...