mirror of
https://github.com/bertptrs/adventofcode.git
synced 2025-12-27 22:00:31 +01:00
Liberally use try, document idea
This commit is contained in:
@@ -16,7 +16,7 @@ locals {
|
||||
|
||||
counts = { for num in local.right : num => num... }
|
||||
|
||||
matching = [for left in local.left : left * length(lookup(local.counts, left, []))]
|
||||
matching = [for left in local.left : left * try(length(local.counts[left]), 0)]
|
||||
}
|
||||
|
||||
output "part1" {
|
||||
|
||||
Reference in New Issue
Block a user