Find Perimeter of Island
Find the perimeter of an island.
Statement
Given a grid representing a map where: :
grid[i][j] = 1
represents landgrid[i][j] = 0
represents water
Each cell is a square with length = 1 and the grid is rectangular.
Find the perimeter of the island.
Level up your interview prep. Join Educative to access 70+ hands-on prep courses.