Compare commits
2 commits
0cf78cd3e3
...
beac30c95f
Author | SHA1 | Date | |
---|---|---|---|
beac30c95f | |||
7132f8733b |
1 changed files with 1 additions and 1 deletions
|
@ -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 })
|
||||
|
|
Loading…
Reference in a new issue