You are given a 2D binary grid containing 1s (representing land) and 0s (representing water). Find and return the perimeter of the island.
The grid contains exactly one island (i.e., one or more connected land cells). The island does not have "lakes" (water inside that isn't connected to the water around the island). One cell is a square with side length 1. Grid cells are connected horizontally and vertically (not diagonally).
Visualizer will appear here