You are given an m n integer matrix grid, where both m and n are even integers, and an integer k.
The matrix is composed of concentric rectangular layers. Rotate each layer of the matrix cyclically in the counterclockwise direction by k positions.
Return the modified grid after performing the rotations.
Constraints:
m == grid.length
n == grid[i].length
m, n
Both m and n are even integers.
grid[i][j]
k
You are given an m n integer matrix grid, where both m and n are even integers, and an integer k.
The matrix is composed of concentric rectangular layers. Rotate each layer of the matrix cyclically in the counterclockwise direction by k positions.
Return the modified grid after performing the rotations.
Constraints:
m == grid.length
n == grid[i].length
m, n
Both m and n are even integers.
grid[i][j]
k