2020-03: Toboggan Trajectory
Part 1
Part 2
over <- c(1, 3, 5, 7, 1)
down <- c(1, 1, 1, 1, 2)
running_total <- 1
for(z in 1:5) {
x <- 1
pounds <- ""
for(y in seq(1, 323, by = down[z])) {
pounds <- paste(pounds, as.character(df[y, x]), sep = "")
if(x + over[z] > 31)
x <- x + over[z] - 31
else
x <- x + over[z]
}
running_total <- running_total * str_count(pounds, "#")
}
running_total
[1] 6818112000