Skip to content

Commit 1c46a1f

Browse files
fix(2018 day-12): off by one, need generation 5,000,000,000, not generation 4,999,999,999
1 parent a3bda60 commit 1c46a1f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

2018/day-12/solution.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const init = (data) => {
5858
}
5959
console.log(`At generation ${stableGeneration} the Δ is ${stableDeltas[0]} and the checksum is ${stableCheckSum}.`)
6060
// Calculate the checksum for 50B generations (minus the generation we're already at)
61-
const answer2 = (stableDeltas[0] * (50000000000 - stableGeneration - 1)) + stableCheckSum
61+
const answer2 = (stableDeltas[0] * (50000000000 - stableGeneration)) + stableCheckSum
6262

6363
console.log(`-- Part 1 --`)
6464
console.log(`Answer: ${answer}`)

0 commit comments

Comments
 (0)