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

whatever

skibidi

skibidi

aylac.top 1bc0a569 bafc9621

verified
Changed files
+3 -10
2015
13
gleam
+3 -10
2015/13/gleam/src/main.gleam
···
Relation(person: String, neighbor: String)
}
-
pub type SingularHappiness =
-
Int
-
pub type SingularHappinessDict =
-
Dict(Relation, SingularHappiness)
-
-
pub type Happiness =
-
Int
pub type HappinessDict =
-
Dict(Relation, Happiness)
pub type People =
Set(String)
···
last_person last_person,
table table,
) {
-
case set.size(people) == 0 {
True -> {
let assert Ok(relation) =
happiness_dict |> dict.get(Relation(last_person, first_person))
···
let people = people |> set.insert("Me")
let happiest_table_with_me = find_happiest_table(happiness_dict, people)
-
"With me: " |> io.print
happiest_table_with_me |> int.to_string |> io.println
}
···
Relation(person: String, neighbor: String)
}
pub type SingularHappinessDict =
+
Dict(Relation, Int)
pub type HappinessDict =
+
Dict(Relation, Int)
pub type People =
Set(String)
···
last_person last_person,
table table,
) {
+
case people |> set.is_empty {
True -> {
let assert Ok(relation) =
happiness_dict |> dict.get(Relation(last_person, first_person))
···
let people = people |> set.insert("Me")
let happiest_table_with_me = find_happiest_table(happiness_dict, people)
happiest_table_with_me |> int.to_string |> io.println
}