def rotate(self, matrix):
        n = len(matrix)
        
        # anti-diagonal mirror
        for i in xrange(n):
            for j in xrange(n - i):
                matrix[i][j], matrix[n-1-j][n-1-i] = matrix[n-1-j][n-i-1], matrix[i][j]
        
        # horizontal mirror
        for i in xrange(n / 2):
            for j in xrange(n):
                matrix[i][j], matrix[n-1-i][j] = matrix[n-1-i][j], matrix[i][j]
                
        return matrix
                
# Time:  O(n^2)
# Space: O(n^2)
dataset/ETHPy150Open kamyu104/LeetCode/Python/rotate-image.py/Solution.rotate/swapped operands of `-`