[p1] be more idiomatic

master
Jacopo De Simoi 3 months ago
parent 59d1467004
commit d41fcb3545
  1. 4
      p1/p1.org

@ -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
number of 0's mod 100; that is what we need for part 1
#+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
#+RESULTS:

Loading…
Cancel
Save