Rotate an n by n matrix clockwise by 90 degrees between one and four times while keeping the entries on both diagonals fixed.
Unlock detailed company stats for this questionUpgrade
Given an n by n integer matrix and a number of turns between 1 and 4, rotate the matrix clockwise by 90 degrees that many times, except that the entries on the main diagonal and the anti-diagonal stay fixed. Only the four triangular regions cut out by the diagonals rotate. Return the resulting matrix.
Community answers
No answers contributed by the community yet.
Related courses

Course
