Tap here to switch tabs
Problem
Submissions

Problem: Transpose Matrix

Transpose Matrix takes a rectangular integer matrix and asks you to return its transpose, exchanging rows and columns even when their counts differ.

Statement

Given a matrix represented as a 2D integer list, return its transpose. The transpose of a matrix is obtained by swapping its rows with its columns or vice versa.

Constraints:

  • 1≤1 \leq m, n ≤100\leq 100

  • −104≤-10^4 \leq matrix[i][j] ≤104\leq 10^4

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Transpose Matrix

Transpose Matrix takes a rectangular integer matrix and asks you to return its transpose, exchanging rows and columns even when their counts differ.

Statement

Given a matrix represented as a 2D integer list, return its transpose. The transpose of a matrix is obtained by swapping its rows with its columns or vice versa.

Constraints:

  • 1≤1 \leq m, n ≤100\leq 100

  • −104≤-10^4 \leq matrix[i][j] ≤104\leq 10^4