transpose an array in javascript code example
Example 1: transpose an array in javascript
array[0].map((_, colIndex) => array.map(row => row[colIndex]));
Example 2: transpose of the matrix in javascript
class Solution {
solve(matrix) {
let arr=[];
for(let i=0;i