For part 1 it is 35.
For part 2 it is 55
An unofficial home for the advent of code community on programming.dev!
Advent of Code is an annual Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like.
Solution Threads
M | T | W | T | F | S | S |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 18 | 20 | 21 | 22 |
23 | 24 | 25 |
Icon base by Lorc under CC BY 3.0 with modifications to add a gradient
console.log('Hello World')
For part 1 it is 35.
For part 2 it is 55
This should be just 35, you can ignore the words that are numbers
First and last number, so loop through the characters, ask is it a letter or a number. Find the first and last number in the string and add the strings together and convert it to a number. So you find a 3,4,5 in the line so find the first in the result is 3 and 5 is the last so it becomes 35.