transpose([[1, 2], [3, 4], [5, 6]]) // β [[1, 3, 5], [2, 4, 6]]transpose flips a matrix over its diagonal, converting rows to columns and vice versa.
Challenge: Implement transpose<T>(matrix: T[][]): T[][] rotating a 2D matrix 90Β° by swapping rows and columns.
transpose([[1,2,3],[4,5,6]]) // β [[1,4],[2,5],[3,6]]