Showing 3 questions
Traverse a given matrix in a spiral pattern, returning all elements in the order you visit them. Essentially, walk around the matrix layer by layer, adding elements to a list.
#1. Spiral Matrix
Given a grid representing land and water, count the number of distinct islands. An island is formed by connected land cells.
#2. Number of Islands
Imagine you're standing at a fixed location looking at points on a 2D plane. Determine the maximum number of points you can see within a given field of view by rotating your position.
#3. Maximum Number of Visible Points