Here is the interview question prompt, presented for reference.
Given an m * n
matrix array, can you print all its elements in a spiral order as shown in the figure below? Try to use only O(1)
space!
100000
-1000000000
and 1000000000
O(n*m)
where n
and m
are the rows and columns respectivelyO(1)
You can see the full challenge with visuals at this link.
Challenges • Asked over 5 years ago by Jake from AlgoDaily
This is the main discussion thread generated for Traverse a Matrix in Spiral Order.