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

Function check_matrix

matrix/spiral_print.py:10–27  ·  view source on GitHub ↗
(matrix: list[list[int]])

Source from the content-addressed store, hash-verified

8
9
10def check_matrix(matrix: list[list[int]]) -> bool:
11 # must be
12 matrix = [list(row) for row in matrix]
13 if matrix and isinstance(matrix, list):
14 if isinstance(matrix[0], list):
15 prev_len = 0
16 for row in matrix:
17 if prev_len == 0:
18 prev_len = len(row)
19 result = True
20 else:
21 result = prev_len == len(row)
22 else:
23 result = True
24 else:
25 result = False
26
27 return result
28
29
30def spiral_print_clockwise(a: list[list[int]]) -> None:

Callers 1

spiral_print_clockwiseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected