Join IDNLearn.com and start getting the answers you've been searching for. Discover reliable answers to your questions with our extensive database of expert knowledge.
Write a function transpose(matrix) that returns the transpose of the input matrix, which is represented as a list of lists. Recall that the transpose of a matrix is obtained by swapping its rows with its columns. More concretely, the equality matrix[i][j] transpose(matrix)[j][i] should hold for all valid indices i and j. You may assume that the input matrix is well-formed, i.e., that each row is of equal length. You may further assume that the input matrix is non-empty. Your function should not modify the input. transpose([[1, 2, 3]]) [[1], [2], [3]] transpose([[1, 2], [3, 4], [5, 6]]) [[1, 3, 5], [2, 4, 6]]
Thank you for using this platform to share and learn. Don't hesitate to keep asking and answering. We value every contribution you make. Thank you for choosing IDNLearn.com for your queries. We’re here to provide accurate answers, so visit us again soon.