Matrix given in memory; the objective is to print the spiral in opposite direction from clockwise (left column down the right lower range, right up column, a series of upper left, etc. until you get to the environment). This works just for dimension 3x3. It should works for MxN dimension, but I don't know how. Any suggestions?
I need code in C++ for this matrix:
1, 2, 3,
4, 5, 6,
7, 8, 9
the result is 1, 4, 7, 8, 9, 6, 3, 2, 5