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 how he figures out which layer he is on. You only want to operate on a single layer at a time. If you were to min the values of the two operations and print it out in the matrix, you would get 0s on the outside, 1s inside of that, then 2s, etc.
e.g.:
000000011110012210012210011110000000
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Matrix Layer Rotation
You are viewing a single comment's thread. Return to all comments →
It's how he figures out which layer he is on. You only want to operate on a single layer at a time. If you were to min the values of the two operations and print it out in the matrix, you would get 0s on the outside, 1s inside of that, then 2s, etc.
e.g.: