We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
My program basically converts each ring of the matrix into a linear array. Once this linear array is constructed, if the number of rotations is "n" then I start from the nth index of the linear array and I copy it to another linear array (rs1 in my program).
That is what the bottom for loop is for!
I thought it would make it easier to copy it back into a matrix but it was timing out.
Matrix Layer Rotation
You are viewing a single comment's thread. Return to all comments →
Sure!
My program basically converts each ring of the matrix into a linear array. Once this linear array is constructed, if the number of rotations is "n" then I start from the nth index of the linear array and I copy it to another linear array (rs1 in my program).
That is what the bottom for loop is for!
I thought it would make it easier to copy it back into a matrix but it was timing out.