aboutsummaryrefslogtreecommitdiffstats
path: root/AoC2022/01/solver.jl
diff options
context:
space:
mode:
Diffstat (limited to 'AoC2022/01/solver.jl')
-rw-r--r--AoC2022/01/solver.jl10
1 files changed, 10 insertions, 0 deletions
diff --git a/AoC2022/01/solver.jl b/AoC2022/01/solver.jl
new file mode 100644
index 0000000..a73deb7
--- /dev/null
+++ b/AoC2022/01/solver.jl
@@ -0,0 +1,10 @@
+using Test
+
+rations = open("input", "r") do f
+ map(x->parse.(Int, eachsplit(x)) |> sum, eachsplit(read(f, String), "\n\n")) |> sort
+end
+
+@testset "solutions" begin
+ @test last(rations) == 75622
+ @test rations[end-2:end] |> sum == 213159
+end