Spring Hire Sale
Limited Time Deal: Unlock all premium questions for over 30% off
$10.42$7.08
08
:
06
:
25
:
14
Back to Dashboard
Largest Island Perimeter
Medium
You are given an m x n binary grid where each cell is either '1' (land) or '0' (water). A group of connected land cells (connected horizontally or vertically, not diagonally) forms an island. Each land cell contributes to its island's perimeter for every edge that borders water or the grid boundary.
Return the maximum perimeter among all islands in the grid. If there are no islands, return 0.
...