diff options
author | Oscar Najera <hi@oscarnajera.com> | 2023-01-26 22:09:57 +0100 |
---|---|---|
committer | Oscar Najera <hi@oscarnajera.com> | 2023-01-26 22:09:57 +0100 |
commit | c7f01066164817bbf624f2e7a63c6ac0aeea5f61 (patch) | |
tree | 8dec4fd44655094ae59ca101672e9ee3ed339f7b /AoC2022/01 | |
parent | 31aa0839953395f5998c7ec4350760cfebae6506 (diff) | |
download | scratch-c7f01066164817bbf624f2e7a63c6ac0aeea5f61.tar.gz scratch-c7f01066164817bbf624f2e7a63c6ac0aeea5f61.tar.bz2 scratch-c7f01066164817bbf624f2e7a63c6ac0aeea5f61.zip |
Learning some julia
Diffstat (limited to 'AoC2022/01')
-rw-r--r-- | AoC2022/01/solver.jl | 10 |
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 |