Papaya Interview Question

Transpose a 2D matrix and print them using Arrays util

Interview Answer

Anonymous

Apr 7, 2020

val trans = Matrix(cols) { Vector(rows) } for (i in 0 until cols) for (j in 0 until rows) trans[i][j] = this[j][i]