Write a component that computes the transpose of a hardcoded 2D array and displays it.
HardProblem Statement
Write a component that computes the transpose of a hardcoded 2D array and displays it.
Sample Input
[[1, 2, 3], [4, 5, 6], [7, 8, 9]]
Sample Output
Transposed Array: [[1, 4, 7], [2, 5, 8], [3, 6, 9]]
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 TransposeMatrix = () => { return ( <div> {/* Display the transposed array */} </div> ); }; export default TransposeMatrix;