https://github.com/freesteph/advent-of-code-23
https://github.com/freesteph/advent-of-code-23
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/freesteph/advent-of-code-23
- Owner: freesteph
- Created: 2022-12-01T09:27:09.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-12-01T09:33:34.000Z (over 3 years ago)
- Last Synced: 2025-10-10T23:24:02.288Z (9 months ago)
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
Awesome Lists containing this project
README
* advent-of-code-2023
** Description
Advent of code 2023
** Day 1
*** Ruby
#+NAME: solution-ruby-day-1
#+begin_src ruby
input = File.read("./inputs/day1")
provisions = input
.split("\n\n")
.map { |group| group.lines.map(&:to_i) }
.map(&:sum)
.max
#+end_src
#+RESULTS: solution-ruby-day-1
: 69310
#+NAME: solution-ruby-day-1-pt2
#+begin_src ruby
input = File.read("./inputs/day1")
provisions = input
.split("\n\n")
.map { |group| group.lines.map(&:to_i) }
.map(&:sum)
.max(3).sum
#+end_src
#+RESULTS: solution-ruby-day-1-pt2
: 206104
*** Lisp
#+NAME: solution-lisp-day-1
#+begin_src emacs-lisp :var input=input-day-1
(let ((groups (split-string input "\n\n"))))
#+end_src
#+RESULTS: solution-lisp-day-1