Skip to content

Commit

Permalink
Add Part II to notes.md
Browse files Browse the repository at this point in the history
  • Loading branch information
samjowen committed Dec 23, 2023
1 parent 84a50a4 commit f9e29a2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/day1/notes.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
# Day 1

Part I:

The challenge that we've been set is to somehow parse through the input file, line by line and find the first and last digits of each line. We then need to add all of the digits to the total to get the final answer.

Part II:

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:

## Possible Solution

Use a loop to go through each line, pattern match 0-9 and put all of the digits into a list. We could then index the first (0th) and last (-1th) digits and add them to the total. We could then move onto the next line and repeat the process.
Expand Down

0 comments on commit f9e29a2

Please sign in to comment.