mirror of
https://github.com/bertptrs/adventofcode.git
synced 2025-12-25 21:00:31 +01:00
2025 day 2 part 1
This commit is contained in:
17
2025/day02/main.tf
Normal file
17
2025/day02/main.tf
Normal file
@@ -0,0 +1,17 @@
|
||||
locals {
|
||||
input = file("../inputs/02.txt")
|
||||
ranges = split(",", chomp(local.input))
|
||||
min_max = [for r in local.ranges : split("-", r)]
|
||||
}
|
||||
|
||||
module "check_range" {
|
||||
source = "./range"
|
||||
count = length(local.min_max)
|
||||
|
||||
min = local.min_max[count.index][0]
|
||||
max = local.min_max[count.index][1]
|
||||
}
|
||||
|
||||
output "part1" {
|
||||
value = sum(module.check_range[*].invalid_sum)
|
||||
}
|
||||
Reference in New Issue
Block a user