mirror of
https://github.com/bertptrs/adventofcode.git
synced 2025-12-27 05:40:32 +01:00
Slightly better performance
This commit is contained in:
@@ -6,6 +6,9 @@ locals {
|
||||
grid = split("\n", chomp(var.input))
|
||||
height = length(local.grid)
|
||||
width = length(local.grid[0])
|
||||
|
||||
lr = length(regexall("XMAS", var.input))
|
||||
rl = length(regexall("SAMX", var.input))
|
||||
}
|
||||
|
||||
module "check_point" {
|
||||
@@ -20,7 +23,7 @@ module "check_point" {
|
||||
}
|
||||
|
||||
output "part1" {
|
||||
value = sum(module.check_point[*].xmas)
|
||||
value = sum(module.check_point[*].xmas) + local.lr + local.rl
|
||||
}
|
||||
|
||||
output "part2" {
|
||||
|
||||
Reference in New Issue
Block a user