|
|
|
@ -17,7 +17,9 @@ First load the data as a list of positive or negative numbers |
|
|
|
Then add the rotations starting from the initial offset and count the |
|
|
|
Then add the rotations starting from the initial offset and count the |
|
|
|
number of 0's mod 100; that is what we need for part 1 |
|
|
|
number of 0's mod 100; that is what we need for part 1 |
|
|
|
#+begin_src emacs-lisp |
|
|
|
#+begin_src emacs-lisp |
|
|
|
(length (--filter (= 0 it) (--map (mod it 100) (-running-sum (append '(50) data))))) |
|
|
|
(length (--filter (= 0 it) |
|
|
|
|
|
|
|
(--map (mod it 100) |
|
|
|
|
|
|
|
(-running-sum (cons 50 data))))) |
|
|
|
#+end_src |
|
|
|
#+end_src |
|
|
|
|
|
|
|
|
|
|
|
#+RESULTS: |
|
|
|
#+RESULTS: |
|
|
|
|