Files
advent-of-code-2025/cmd/03/main.go
T

19 lines
369 B
Go
Raw Normal View History

2025-12-05 07:05:28 -06:00
package main
import (
"github.com/StevanFreeborn/advent-of-code-2025/cmd/03/bank"
"github.com/StevanFreeborn/advent-of-code-2025/internal/file"
)
2025-12-06 07:34:42 -06:00
func Solve(filePath string, numOfCells int) int64 {
2025-12-05 07:05:28 -06:00
input := file.ReadLines(filePath)
2025-12-06 07:34:42 -06:00
total := int64(0)
2025-12-05 07:05:28 -06:00
for _, line := range input {
bank := bank.From(line)
2025-12-06 07:34:42 -06:00
total += bank.Joltage(numOfCells)
2025-12-05 07:05:28 -06:00
}
return total
}