Forgot to add

This commit is contained in:
2025-12-02 09:58:16 +01:00
parent 027a7bdde6
commit f132842b5c

27
2025/day02/range2/main.tf Normal file
View File

@@ -0,0 +1,27 @@
variable "min" {
type = number
}
variable "max" {
type = number
}
locals {
digits = length(tostring(var.max))
}
module "range" {
source = "../range"
count = local.digits
max = var.max
min = var.min
repetitions = count.index + 1
}
locals {
results = setunion(module.range[*].invalid...)
}
output "invalid_sum" {
value = length(local.results) > 0 ? sum(local.results) : 0
}