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
··· 10 10 Relation(person: String, neighbor: String) 11 11 } 12 12 13 - pub type SingularHappiness = 14 - Int 15 - 16 13 pub type SingularHappinessDict = 17 - Dict(Relation, SingularHappiness) 18 - 19 - pub type Happiness = 20 - Int 14 + Dict(Relation, Int) 21 15 22 16 pub type HappinessDict = 23 - Dict(Relation, Happiness) 17 + Dict(Relation, Int) 24 18 25 19 pub type People = 26 20 Set(String) ··· 37 31 last_person last_person, 38 32 table table, 39 33 ) { 40 - case set.size(people) == 0 { 34 + case people |> set.is_empty { 41 35 True -> { 42 36 let assert Ok(relation) = 43 37 happiness_dict |> dict.get(Relation(last_person, first_person)) ··· 170 164 let people = people |> set.insert("Me") 171 165 172 166 let happiest_table_with_me = find_happiest_table(happiness_dict, people) 173 - "With me: " |> io.print 174 167 happiest_table_with_me |> int.to_string |> io.println 175 168 }