Skip to content

Commit

Permalink
d
Browse files Browse the repository at this point in the history
  • Loading branch information
martijnkunstman committed Dec 1, 2023
1 parent 457f7a7 commit 6823172
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions day1/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ fetch("./day1/input2.txt").then((r) => r.text()).then((d) => {
replaceNumbers.map((a, i) => d = d.replaceAll(a, a[0]+(i + 1)+a.slice(-1)))
result(d)
})
let result = (input) => {
let result = (d) => {
answer = 0
input.split("-").map((a) => {
d.split("-").map((a) => {
first = a.split('').find((b) => !isNaN(b))
last = a.split('').findLast((b) => !isNaN(b))
answer += Number(first + "" + last)
Expand Down

0 comments on commit 6823172

Please sign in to comment.