Check if the board (matrix) has been completely filled with non-zero values. >>> is_complete([[1]]) True >>> is_complete([[1, 2], [3, 0]]) False
(board: list[list[int]])
| 33 | |
| 34 | |
| 35 | def is_complete(board: list[list[int]]) -> bool: |
| 36 | """ |
| 37 | Check if the board (matrix) has been completely filled with non-zero values. |
| 38 | |
| 39 | >>> is_complete([[1]]) |
| 40 | True |
| 41 | |
| 42 | >>> is_complete([[1, 2], [3, 0]]) |
| 43 | False |
| 44 | """ |
| 45 | |
| 46 | return not any(elem == 0 for row in board for elem in row) |
| 47 | |
| 48 | |
| 49 | def open_knight_tour_helper( |
no outgoing calls
no test coverage detected