Answers for "transpose of the matrix in javascript"

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