removed debug message, fixed grammar error

This commit is contained in:
Heiko Ludwig 2024-12-04 11:51:21 +01:00
parent c8dc6578f9
commit 57b61da0bc

View file

@ -35,7 +35,7 @@ def check_xmas_from_pos(grid: list, row: int, col: int,
if new_col < 0 or new_col >= len(grid[0]): if new_col < 0 or new_col >= len(grid[0]):
return False return False
# go deeper into recursion with one less letter on the search string # go deeper into recursion with one less letter in the search string
return check_xmas_from_pos(grid, new_row, new_col, direction, xmas_letters[1:]) return check_xmas_from_pos(grid, new_row, new_col, direction, xmas_letters[1:])
@ -47,7 +47,6 @@ def get_xmas_appearances(grid: list) -> int:
for col in range(len(grid[0])): for col in range(len(grid[0])):
for direction in directions: for direction in directions:
if check_xmas_from_pos(grid, row, col, direction, xmas_letters): if check_xmas_from_pos(grid, row, col, direction, xmas_letters):
# print(f"Found XMAS at position ({row}, {col}) in direction {direction}")
xmas_appearances += 1 xmas_appearances += 1
return xmas_appearances return xmas_appearances