Example 72: Access 2-D Array Elements in a Spiral
Learn how to access elements of a matrix in a spiral manner.
We'll cover the following...
Problem
Given a 2-D array of size 4 x 4, write a function to visit all its elements in a spiral fashion.
Example
Input | Output |
---|