Skip to content

Commit 6dc00f0

Browse files
committed
Add function that returns sum of part numbers in the engine schematic
1 parent 542e876 commit 6dc00f0

File tree

1 file changed

+6
-1
lines changed
  • puzzles/solutions/2023/d03

1 file changed

+6
-1
lines changed

puzzles/solutions/2023/d03/p1.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
import sys
22

3+
from schematic_parser import SchematicParser
4+
35

46
def get_answer(input_text: str):
5-
raise NotImplementedError
7+
"""Return the sum of all part numbers in the engine schematic."""
8+
schematic_parser = SchematicParser(input_text)
9+
part_numbers = schematic_parser.find_part_numbers()
10+
return sum(part_numbers)
611

712

813
if __name__ == "__main__":

0 commit comments

Comments
 (0)