Fix typo in knight_tour.py (#11173)

This commit is contained in:
MC 2023-11-25 19:17:59 +08:00 committed by GitHub
parent 3999abfea3
commit b8e7a4c76c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,7 +79,7 @@ def open_knight_tour(n: int) -> list[list[int]]:
>>> open_knight_tour(2) >>> open_knight_tour(2)
Traceback (most recent call last): Traceback (most recent call last):
... ...
ValueError: Open Kight Tour cannot be performed on a board of size 2 ValueError: Open Knight Tour cannot be performed on a board of size 2
""" """
board = [[0 for i in range(n)] for j in range(n)] board = [[0 for i in range(n)] for j in range(n)]
@ -91,7 +91,7 @@ def open_knight_tour(n: int) -> list[list[int]]:
return board return board
board[i][j] = 0 board[i][j] = 0
msg = f"Open Kight Tour cannot be performed on a board of size {n}" msg = f"Open Knight Tour cannot be performed on a board of size {n}"
raise ValueError(msg) raise ValueError(msg)