You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
locals { |
|
raw = file("../input.txt") |
|
nums = split("\n", local.raw) |
|
increments = [for i, num in local.nums: i > 0 ? local.nums[i] > local.nums[i - 1] ? 1 : 0 : 0] |
|
counts = sum(local.increments) |
|
} |
|
|
|
output "result" { |
|
value = local.counts |
|
} |