···66# Parse input.
77for y, line in enumerate(fileinput.input()):
88 num = ''
99- start = None
1010- for x, c in enumerate(line.strip()):
1111- if not c.isdigit() and c != '.':
99+ for x, c in enumerate(line):
1010+ if not c.isdigit() and c != '.' and c != '\n':
1211 SYMBOLS[x, y] = c
13121413 if c.isdigit():
···1615 start = x
1716 num += c
1817 elif num:
1919- PARTS.append((int(num), y, start, x - 1))
1818+ PARTS.append((int(num), y, x - len(num), x - 1))
2019 num = ''
2121-2222- if num:
2323- PARTS.append((int(num), y, start, x - 1))
24202521# Solve problem.
2622part_1_seen = set()