MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / transpose

Function transpose

matrix/rotate_matrix.py:64–66  ·  view source on GitHub ↗
(matrix: list[list[int]])

Source from the content-addressed store, hash-verified

62
63
64def transpose(matrix: list[list[int]]) -> list[list[int]]:
65 matrix[:] = [list(x) for x in zip(*matrix)]
66 return matrix
67
68
69def reverse_row(matrix: list[list[int]]) -> list[list[int]]:

Callers 2

rotate_90Function · 0.70
rotate_270Function · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected