Perimeter Island
Recursively find the perimeter of an island in a 2D grid given a point on the island.
Complexity: O(|P|) time and space where |P| is the length of the perimeter
Last updated
Recursively find the perimeter of an island in a 2D grid given a point on the island.
Complexity: O(|P|) time and space where |P| is the length of the perimeter
Last updated
The Idea: DFS through the grid. Search through all 8 half orthogonal directions on the euclidean plane.