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.
You don't even have to initially store all the values in an array. Store the values in your "result" array as you read them. Small fix. Instead of doing
result[row][col]=arr[r][c]
you can just do this
scanf("%d",&result[row][col]);
and avoid having to store all the values twice.
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 →
Good solution.
You don't even have to initially store all the values in an array. Store the values in your "result" array as you read them. Small fix. Instead of doing
you can just do this
and avoid having to store all the values twice.