Welcome to my solution for Day 1 of Advent of Code 2023, titled "Trebuchet?!".
- Task: Unravel the calibration values hidden in a document, where each line is a clue.
- Method: Combine the first and last digits of each line into a magical two-digit number.
- Example:
1abc2 ➡️ 12
pqr3stu8vwx ➡️ 38
a1b2c3d4e5f ➡️ 15
treb7uchet ➡️ 77 - Goal: Sum up all the calibration values.
- Solution Result: 54940
- Enhancement: Discover digits disguised as words.
- Task: Identify the real first and last digit on each line, whether numeric or spelled out.
- Example:
two1nine ➡️ 29
eightwothree ➡️ 83
abcone2threexyz ➡️ 13
xtwone3four ➡️ 24
4nineeightseven2 ➡️ 42
zoneight234 ➡️ 14
7pqrstsixteen ➡️ 76 - Goal: Calculate the sum of these updated calibration values.
- Solution Result: 54208
- I found some Java under my Christmas Tree 🎅🏻