How to go around the perimeter of a rectangular matrix in one cycle?
- Use the extreme cell index as an option. Add your work (your code), otherwise the question will rather be closed as a training - LFC
- Study assignments are allowed as questions only under the condition that you tried to solve them yourself before asking a question. Please edit the question and indicate what caused you difficulties in solving the problem. For example, give the code you wrote trying to solve the problem - LFC
- Here is ru.stackoverflow.com/a/761797/182825 I gave the implementation of the "ring iterator" for the matrix. Such an iterator allows you to go around the ring in the matrix (including along the perimeter) “in one cycle”. - AnT
|