aboutsummaryrefslogtreecommitdiffstats
path: root/AoC2022/01
diff options
context:
space:
mode:
authorOscar Najera <hi@oscarnajera.com>2023-01-26 22:09:57 +0100
committerOscar Najera <hi@oscarnajera.com>2023-01-26 22:09:57 +0100
commitc7f01066164817bbf624f2e7a63c6ac0aeea5f61 (patch)
tree8dec4fd44655094ae59ca101672e9ee3ed339f7b /AoC2022/01
parent31aa0839953395f5998c7ec4350760cfebae6506 (diff)
downloadscratch-c7f01066164817bbf624f2e7a63c6ac0aeea5f61.tar.gz
scratch-c7f01066164817bbf624f2e7a63c6ac0aeea5f61.tar.bz2
scratch-c7f01066164817bbf624f2e7a63c6ac0aeea5f61.zip
Learning some julia
Diffstat (limited to 'AoC2022/01')
-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