diff --git a/5/advent_2.py b/5/advent_2.py index 0726b24..a1cf842 100755 --- a/5/advent_2.py +++ b/5/advent_2.py @@ -81,7 +81,7 @@ def findmapping(sr, tables, prefix): print(f"{prefix}Mapping {row} {sr} {len(tables)}") allresults.append( findmapping( - SR(row.target + (sr.startpoint - row.source), sr.length), + SR(row.target + (sr.startpoint - row.source), row.endpoint - sr.startpoint), tables, prefix + "#", ) @@ -98,7 +98,7 @@ def findmapping(sr, tables, prefix): return min(allresults) -with open("data2.txt") as file: +with open("data.txt") as file: lines = [line.rstrip() for line in file] tables = []