Create a component that rotates a hardcoded 2D matrix by 90 degrees clockwise and displays the result.
HardProblem Statement
Create a component that rotates a hardcoded 2D matrix by 90 degrees clockwise and displays the result.
Sample Input
[[1, 2, 3], [4, 5, 6], [7, 8, 9]]
Sample Output
Rotated Matrix: [[7, 4, 1], [8, 5, 2], [9, 6, 3]]
Limits
Time: 2s · Memory: 256 MB
Code Editor
Log in to submit00:00
Try your code in this preview. Submit marks it done.
import React from "react"; const RotateMatrix = () => { return ( <div> {/* Display the rotated matrix */} </div> ); }; export default RotateMatrix;