...

/

Find Perimeter of Island

Find Perimeter of Island

Find the perimeter of an island.

Statement

Given a grid representing a map where: :

  • grid[i][j] = 1 represents land
  • grid[i][j] = 0 represents water

Each cell is a square with length = 1 and the grid is rectangular.

Find the perimeter of the island.

Access this course and 1400+ top-rated courses and projects.