1
0
Fork 0

Compare commits

..

2 commits

Author SHA1 Message Date
beac30c95f
add total of stars to README 2024-12-03 07:22:52 -05:00
7132f8733b
also solve day 2 using gleam 2024-12-03 07:22:52 -05:00

View file

@ -25,7 +25,7 @@ pub fn main() {
fn is_safe(report: Report) -> Bool {
let diffs =
report
|> list.zip(with: list.drop(report, 1))
|> list.window_by_2()
|> list.map(fn(p) { pair.first(p) - pair.second(p) })
list.all(diffs, fn(n) { 1 <= n && n <= 3 })