inst/run-day09.R

library(adventofcode20)
x <- as.numeric(readLines("./inst/input09.txt"))

p1 <- find_xmas_preamble_mismatch(x, 25)
p2_raw <- find_summing_streak(x, p1)
p2 <- sum(range(p2_raw))

stopifnot(p1 == aoc20_solutions$day09a)
stopifnot(p2 == aoc20_solutions$day09b)
tjmahr/adventofcode20 documentation built on Dec. 31, 2020, 8:39 a.m.