Solve 2018 day 18

This commit is contained in:
2024-07-21 16:16:14 -04:00
parent b88326a7d1
commit 9f616a5b81
3 changed files with 73 additions and 1 deletions

3
lib.py
View File

@@ -56,6 +56,9 @@ class Grid2D:
row, col = pos
self.grid[row][col] = val
def hash(self):
return tuple(map(lambda row: tuple(row), self.grid))
def clone_with_val(self, val):
c = Grid2D("d\nd")
c.n_rows = self.n_rows