Tag: rotatematrix
-
Data Structures & Algorithms in Java – Matrix – Rotate Image
Problem: Given a n * n matrix representing an image , rotate the matrix by 90 degrees . Constraints: Do not use any extra memory in proportion to the input size. That is , space complexity should be 1. For example, For the input : [ [1,2,3], [4,5,6], [7,8,9]] The output is : [[7,4,1], [8,5,2],…