Rotate Matrix

Problem Overview

  • Rotate an N×M matrix by 90 degrees and output the transformed matrix.
  • Input: two integers N and M, followed by matrix entries; constraint: N = M (square matrix).
  • Output: the matrix after a 90-degree rotation, printed in standard row order.
  • Real-world domain: matrix manipulation and image/data processing tasks.
  • From Cisco interviews; a common coding interview problem and interview question.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: