mirror of
https://github.com/bertptrs/adventofcode.git
synced 2025-12-25 21:00:31 +01:00
Slightly better performance
This commit is contained in:
@@ -22,8 +22,6 @@ locals {
|
||||
"UL" = [-1, -1]
|
||||
"U" = [0, -1]
|
||||
"UR" = [1, -1]
|
||||
"L" = [-1, 0]
|
||||
"R" = [1, 0]
|
||||
"DL" = [-1, 1]
|
||||
"D" = [0, 1]
|
||||
"DR" = [1, 1]
|
||||
|
||||
@@ -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