This commit is contained in:
Hamcha 2024-12-03 22:20:15 +01:00
parent 98e332f9a1
commit 43035cf142
Signed by: hamcha
GPG key ID: 1669C533B8CF6D89
2 changed files with 8 additions and 6 deletions

View file

@ -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
}

View file

@ -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
}