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.
There's actually no need to waste time physically rotating the matrix. Simply logicaly rotate it.
for i = 0 to m - 1 do
for j = 0 to n - 1 do
let (x, y) =
coordinates_before_rotation r (m, n) (i, j)
in
print_int mat.(x).(y);
print_string " "
done;
print_string "\n";
done
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 →
There's actually no need to waste time physically rotating the matrix. Simply logicaly rotate it.