Answers for "javascript transpose array"

1

javascript transpose array

transpose = m => m[0].map((x,i) => m.map(x => x[i]))
Posted by: Guest on September-25-2021
2

transpose an array in javascript

array[0].map((_, colIndex) => array.map(row => row[colIndex]));
Posted by: Guest on July-02-2020
0

transpose of the matrix in javascript

class Solution {
    solve(matrix) {
        let arr=[];
        for(let i=0;i<matrix.length;i++){
            arr.push([])
            for(let j=0;j<matrix.length;j++){
                arr[i].push(matrix[j][i])
            }
        }
        return arr
    }
}
Posted by: Guest on June-24-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language