Advent of Code 2020

1.R 210B

12345678
  1. input <- as.numeric(readLines("input1.txt"))
  2. sum(input)
  3. # I should have worked out how to automate finding this, but I didn't want to do a loop
  4. ic <- cumsum(rep(input, length.out = 139435))
  5. table(table(ic))