Solve 2021 day 20, 21, 23, 25

This commit is contained in:
2024-11-27 17:31:52 -05:00
parent 4acc229c5a
commit a2a6ca52d1
8 changed files with 388 additions and 1 deletions

4
lib.py
View File

@@ -59,6 +59,10 @@ class Grid2D:
def hash(self):
return tuple(map(lambda row: tuple(row), self.grid))
def clone(self):
from copy import deepcopy
return deepcopy(self)
def clone_with_val(self, val):
c = Grid2D("d\nd")
c.n_rows = self.n_rows