feat: Add similarity score calculation for Day 1 Part 2

This commit is contained in:
Ruidy (aider) 2024-12-01 10:12:03 +01:00 committed by Ruidy
parent dc74c4a7b1
commit bbf027d22a
No known key found for this signature in database
GPG key ID: E00F51288CB857CC

View file

@ -16,10 +16,11 @@ defmodule AdventCode2024Test do
input = "1\t2\n3\t4\n5\t6"
assert {[1, 3, 5], [2, 4, 6]} = AdventCode2024.parse_input(input)
end
test "calculates total distance between two lists using example input" do
left_list = [3, 4, 2, 1, 3, 3]
right_list = [4, 3, 5, 3, 9, 3]
assert AdventCode2024.calculate_total_distance(left_list, right_list) == 11
end
@ -36,7 +37,7 @@ defmodule AdventCode2024Test do
test "calculates similarity score using example input" do
left_list = [3, 4, 2, 1, 3, 3]
right_list = [4, 3, 5, 3, 9, 3]
assert AdventCode2024.calculate_similarity_score(left_list, right_list) == 31
end