>>> rotate_180(make_matrix()) [[16, 15, 14, 13], [12, 11, 10, 9], [8, 7, 6, 5], [4, 3, 2, 1]] >>> rotate_180(make_matrix()) == reverse_column(reverse_row(make_matrix())) True
(matrix: list[list[int]])
| 38 | |
| 39 | |
| 40 | def rotate_180(matrix: list[list[int]]) -> list[list[int]]: |
| 41 | """ |
| 42 | >>> rotate_180(make_matrix()) |
| 43 | [[16, 15, 14, 13], [12, 11, 10, 9], [8, 7, 6, 5], [4, 3, 2, 1]] |
| 44 | >>> rotate_180(make_matrix()) == reverse_column(reverse_row(make_matrix())) |
| 45 | True |
| 46 | """ |
| 47 | |
| 48 | return reverse_row(reverse_column(matrix)) |
| 49 | # OR.. reverse_column(reverse_row(matrix)) |
| 50 | |
| 51 | |
| 52 | def rotate_270(matrix: list[list[int]]) -> list[list[int]]: |
no test coverage detected