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.
It's easier to shift around the indices rather than the actual elements. My approach was to not alter the original matrix, but for each index figure out where it would end up, and print appropriately.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Matrix Rotation
You are viewing a single comment's thread. Return to all comments →
It's easier to shift around the indices rather than the actual elements. My approach was to not alter the original matrix, but for each index figure out where it would end up, and print appropriately.