Rotating the Box

Solution Code

Time Complexity

O(m × n^2)

Space Complexity

O(m × n)