mirror of
https://github.com/bertptrs/adventofcode.git
synced 2025-12-26 21:30:31 +01:00
12 lines
209 B
HCL
12 lines
209 B
HCL
variable "input" {
|
|
type = string
|
|
}
|
|
|
|
locals {
|
|
muls = regexall("mul\\((\\d+),(\\d+)\\)", var.input)
|
|
}
|
|
|
|
output "part1" {
|
|
value = sum([for mul in local.muls : parseint(mul[1], 10) * parseint(mul[0], 10)])
|
|
}
|