Skip to content

Commit 8a61f51

Browse files
committed
Solution for day 12, second problem, based on manual pattern recognition ;)
1 parent 4dd3c4b commit 8a61f51

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

day12_2.rkt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#lang racket
2+
3+
(require "day12_1.rkt")
4+
5+
; Look for a pattern
6+
(define inputs
7+
(list 20 100 200 300 500 1000 2000 2001 2002 2003 3000))
8+
9+
(for ([i inputs])
10+
(println
11+
(time
12+
(solve-puzzle i #f (file->lines "day12_input.txt")))))
13+
14+
; Pattern: Iteration Result for 2002 is IR for 2001 + 75 is IR for 2000 + 75 ...
15+
(+ 151113 (* 75 (- 50000000000 2000)))

0 commit comments

Comments
 (0)