|
|
|
|
@ -101,13 +101,13 @@ The solution of part 1 is |
|
|
|
|
#+begin_src emacs-lisp |
|
|
|
|
(-reduce #'+ (--map (* (car it) (cdr it)) |
|
|
|
|
(-zip-pair (-map #'length regions) |
|
|
|
|
(-map (lambda (region) (-reduce #'+ (-map #'count-fence region))) regions)))) ;part 1 |
|
|
|
|
(-map (lambda (region) (-reduce #'+ (-map #'count-fence region))) regions)))) |
|
|
|
|
#+end_src |
|
|
|
|
The solution of part 2 is |
|
|
|
|
#+begin_src emacs-lisp |
|
|
|
|
(-reduce #'+ (--map (* (car it) (cdr it)) |
|
|
|
|
(-zip-pair (-map #'length regions) |
|
|
|
|
(-map (lambda (region) (-reduce #'+ (-map #'count-vertices region))) regions)))) ;part 2 |
|
|
|
|
(-map (lambda (region) (-reduce #'+ (-map #'count-vertices region))) regions)))) |
|
|
|
|
#+end_src |
|
|
|
|
|
|
|
|
|
#+RESULTS: |
|
|
|
|
|