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

ok i wasnt the one who came up with this

aylac.top fb83ec26 3238299d

verified
Changed files
+4 -11
2025
3
gleam
+4 -11
2025/3/gleam/src/main.gleam
··· 1 - import gleam/float 2 1 import gleam/int 3 2 import gleam/io 4 3 import gleam/list ··· 10 9 input 11 10 |> list.fold(0, fn(acc, bank) { 12 11 let #(n, _) = 13 - list.range(digits, 1) 12 + list.range(digits - 1, 0) 14 13 |> list.fold(#(0, bank), fn(acc, i) { 15 14 let #(number, bank) = acc 15 + 16 16 let bank_find = 17 17 bank 18 18 |> list.reverse 19 - |> list.drop(i - 1) 19 + |> list.drop(i) 20 20 |> list.reverse 21 21 22 22 let max = ··· 30 30 |> list.key_find(max) 31 31 |> result.unwrap(0) 32 32 33 - #( 34 - number 35 - + max 36 - * float.round( 37 - int.power(10, int.to_float(i - 1)) |> result.unwrap(0.0), 38 - ), 39 - list.drop(bank, max_loc + 1), 40 - ) 33 + #(number * 10 + max, list.drop(bank, max_loc + 1)) 41 34 }) 42 35 acc + n 43 36 })