← Back to all problems
Easy

Transpose Matrix

Updated Feb 24, 2026

Problem

Return the transpose of matrix.

Constraints

1 <= rows, cols <= 100

Examples

Example 1

Input: {"matrix": [[1, 2, 3], [4, 5, 6]]}
Output: [[1, 4], [2, 5], [3, 6]]

Function Signature

def transpose(self, matrix: list[list[int]]) -> list[list[int]]

How to Submit

Implement a Solution class with a transpose method.

Your method will be called with the input parameters and should return the answer.