advent-of-code-2023/day-1/part-2
2023-12-06 08:46:47 -06:00
..
part-2.py Add part 2 (digit1 detection works) 2023-12-06 08:46:47 -06:00
readme.md Add part 2 (digit1 detection works) 2023-12-06 08:46:47 -06:00

Day 1 - Part 2

Your calculation isn't quite right. It looks like some of the digits are actually spelled out with letters: one, two, three, four, five, six, seven, eight, and nine also count as valid "digits".

Equipped with this new information, you now need to find the real first and last digit on each line. For example:

two1nine
eightwothree
abcone2threexyz
xtwone3four
4nineeightseven2
zoneight234
7pqrstsixteen

In this example, the calibration values are 29, 83, 13, 24, 42, 14, and 76. Adding these together produces 281.