Add optimized implementation for matrix rotation Time: O(n^2) and Space
O(1)