From c7f01066164817bbf624f2e7a63c6ac0aeea5f61 Mon Sep 17 00:00:00 2001 From: Oscar Najera Date: Thu, 26 Jan 2023 22:09:57 +0100 Subject: Learning some julia --- AoC2022/01/solver.jl | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 AoC2022/01/solver.jl (limited to 'AoC2022/01/solver.jl') 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 -- cgit v1.2.3