From 43035cf142360c86126d48167d36dc1ffe032648 Mon Sep 17 00:00:00 2001 From: Hamcha Date: Tue, 3 Dec 2024 22:20:15 +0100 Subject: [PATCH] ... --- src/day2_p1.gleam | 6 +++--- src/day2_p2.gleam | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/day2_p1.gleam b/src/day2_p1.gleam index 139f87b..89fc980 100644 --- a/src/day2_p1.gleam +++ b/src/day2_p1.gleam @@ -1,7 +1,7 @@ import gleam/int import gleam/io import gleam/iterator -import gleam/list.{count, filter_map, map} +import gleam/list.{count, filter, filter_map, reverse} import gleam/string import stdin.{stdin} @@ -46,6 +46,6 @@ fn parse(it: iterator.Iterator(String)) -> List(List(Int)) { } } }) - |> list.filter(fn(l) { list.length(l) > 0 }) - |> list.reverse + |> filter(fn(l) { list.length(l) > 0 }) + |> reverse } diff --git a/src/day2_p2.gleam b/src/day2_p2.gleam index f173d27..921ce54 100644 --- a/src/day2_p2.gleam +++ b/src/day2_p2.gleam @@ -1,7 +1,9 @@ import gleam/int import gleam/io import gleam/iterator -import gleam/list.{any, count, filter_map, flatten, length, range, split} +import gleam/list.{ + any, count, filter, filter_map, flatten, length, range, reverse, split, +} import gleam/string import stdin.{stdin} @@ -54,6 +56,6 @@ fn parse(it: iterator.Iterator(String)) -> List(List(Int)) { } } }) - |> list.filter(fn(l) { list.length(l) > 0 }) - |> list.reverse + |> filter(fn(l) { list.length(l) > 0 }) + |> reverse }