summaryrefslogtreecommitdiff
path: root/2026
diff options
context:
space:
mode:
Diffstat (limited to '2026')
-rw-r--r--2026/.gitignore16
-rw-r--r--2026/1.hs10
l---------2026/Makefile1
-rwxr-xr-x2026/get_input.sh3
4 files changed, 30 insertions, 0 deletions
diff --git a/2026/.gitignore b/2026/.gitignore
new file mode 100644
index 0000000..dc0f47d
--- /dev/null
+++ b/2026/.gitignore
@@ -0,0 +1,16 @@
+aoc-cookie.txt
+*.o
+*.hi
+*.in
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
diff --git a/2026/1.hs b/2026/1.hs
new file mode 100644
index 0000000..e36246b
--- /dev/null
+++ b/2026/1.hs
@@ -0,0 +1,10 @@
+{-# OPTIONS -Wno-x-partial #-}
+module Main where
+
+import Control.Arrow
+import Control.Monad (join)
+import Data.Bifunctor (bimap)
+import Data.List (group, sort)
+
+main :: IO ()
+main = runKleisli (const () ^<< join (***) (Kleisli print)) . join bimap (product . map snd . take 3) . (reverse &&& id) . sort . map (length &&& head) . group . sort . map (read @Int) . words =<< getContents
diff --git a/2026/Makefile b/2026/Makefile
new file mode 120000
index 0000000..17e64eb
--- /dev/null
+++ b/2026/Makefile
@@ -0,0 +1 @@
+../2024/Makefile \ No newline at end of file
diff --git a/2026/get_input.sh b/2026/get_input.sh
new file mode 100755
index 0000000..5f396b0
--- /dev/null
+++ b/2026/get_input.sh
@@ -0,0 +1,3 @@
+#!/usr/bin/env bash
+set -eu
+curl -H "Cookie: session=$(cat aoc-cookie.txt)" https://adventofcode.com/2026/day/"$1"/input >"$1".in