2023 Day 17 Complete

This commit is contained in:
2023-12-17 10:52:08 -06:00
parent a34f05d1af
commit d64a18280f
16 changed files with 517 additions and 131 deletions

View File

@@ -6,18 +6,18 @@ import (
"sort"
"strings"
"../../"
h "git.bullercodeworks.com/brian/adventofcode/helpers"
)
func main() {
part1 := aoc.ArgIsSet("-1")
justSort := aoc.ArgIsSet("-sort")
input := aoc.StdinToStringSlice()
part1 := h.ArgIsSet("-1")
justSort := h.ArgIsSet("-sort")
input := h.StdinToStringSlice()
var blacklists []Blacklist
for i := range input {
pts := strings.Split(input[i], "-")
st := aoc.Atoi(pts[0])
end := aoc.Atoi(pts[1])
st := h.Atoi(pts[0])
end := h.Atoi(pts[1])
blacklists = append(blacklists, *CreateBlacklist(st, end))
}
sort.Sort(ByStart(blacklists))