Solve day 5

This commit is contained in:
Aurélien Geron
2024-12-09 10:19:50 +13:00
parent 499a6f145d
commit 9808ad404c
3 changed files with 89 additions and 14 deletions
+37
View File
@@ -70,4 +70,41 @@ defmodule Aoc2024Test do
assert Aoc2024.Day04.part1(parsed_input) == 18
assert Aoc2024.Day04.part2(parsed_input) == 9
end
test "Day 5" do
input = """
47|53
97|13
97|61
97|47
75|29
61|13
75|53
29|13
97|29
53|29
61|53
97|53
61|29
47|13
75|47
97|75
47|61
75|61
47|29
75|13
53|13
75,47,61,53,29
97,61,53,29,13
75,29,13
75,97,47,61,53
61,13,29
97,13,75,29,47
"""
parsed_input = Aoc2024.Day05.parse(input)
assert Aoc2024.Day05.part1(parsed_input) == 143
assert Aoc2024.Day05.part2(parsed_input) == 123
end
end