my solutions to advent of code
aoc advent-of-code

day 13 2015 - this looks a bit more sane

aylac.top 0a157a9f a3188bf4

verified
Changed files
+4 -6
2015
13
gleam
+4 -6
2015/13/gleam/src/main.gleam
···
<> { last_person <> " and " <> person }
<> " was not found"
}
-
// gonna be honest i have no idea why this part works i feel ashamed
+
// ok so i figured out why this works, it's because it's only comparing to stuff that starts at the same level
let table =
-
table
-
+ relation
-
+ do_find_happiest_table(
+
do_find_happiest_table(
happiness_dict,
people |> set.delete(person),
happiest_table,
first_person,
last_person: person,
-
table: table,
+
table: table + relation,
)
case table > happiest_table {
True -> table
···
happiest_table |> int.to_string |> io.println
"Part 2" |> io.println
-
let relations_with_me: SingularHappinessDict =
+
let relations_with_me: HappinessDict =
people
|> set.to_list
|> list.map(fn(person) {