AdventOfCode > 2022
Part 1:
I manually downloaded my personal day 11 input file as a logged user, and here I get the data in a more appropriate shape.
── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ──
✔ ggplot2 3.4.0 ✔ purrr 1.0.1
✔ tibble 3.1.8 ✔ dplyr 1.1.0
✔ tidyr 1.2.1 ✔ stringr 1.5.0.9000
✔ readr 2.1.3 ✔ forcats 0.5.2
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
library(zeallot)
file <- here::here("2022/11_input")
data <- file %>%
read_delim(
delim = ":",
col_names = c("key","value"),
show_col_types = FALSE,
skip_empty_rows = FALSE
)
Warning: One or more parsing issues, call `problems()` on your data frame for details,
e.g.:
dat <- vroom(...)
problems(dat)
# A tibble: 55 × 2
key value
<chr> <chr>
1 "Monkey 0" <NA>
2 " Starting items" " 98, 89, 52"
3 " Operation" " new = old * 2"
4 " Test" " divisible by 5"
5 " If true" " throw to monkey 6"
6 " If false" " throw to monkey 1"
7 <NA> <NA>
8 "Monkey 1" <NA>
9 " Starting items" " 57, 95, 80, 92, 57, 78"
10 " Operation" " new = old * 13"
# … with 45 more rows
I parse monkey data in tabular format.
status <- data %>%
mutate(monkey = cumsum(is.na(key))) %>%
filter(!is.na(value)) %>%
mutate(across(everything(), str_trim)) %>%
pivot_wider(names_from = key, values_from = value) %>%
janitor::clean_names() %>%
mutate(starting_items = strsplit(starting_items, ", ") %>% map(~parse_integer(.x))) %>%
mutate(operation = str_extract(operation, "new = (.*)", group = 1)) %>%
mutate(across(test:if_false, parse_number)) %>%
group_by(monkey) %>%
group_split()
status
<list_of<
tbl_df<
monkey : character
starting_items: list
operation : character
test : double
if_true : double
if_false : double
>
>[8]>
[[1]]
# A tibble: 1 × 6
monkey starting_items operation test if_true if_false
<chr> <list> <chr> <dbl> <dbl> <dbl>
1 0 <int [3]> old * 2 5 6 1
[[2]]
# A tibble: 1 × 6
monkey starting_items operation test if_true if_false
<chr> <list> <chr> <dbl> <dbl> <dbl>
1 1 <int [6]> old * 13 2 2 6
[[3]]
# A tibble: 1 × 6
monkey starting_items operation test if_true if_false
<chr> <list> <chr> <dbl> <dbl> <dbl>
1 2 <int [7]> old + 5 19 7 5
[[4]]
# A tibble: 1 × 6
monkey starting_items operation test if_true if_false
<chr> <list> <chr> <dbl> <dbl> <dbl>
1 3 <int [5]> old + 6 7 0 4
[[5]]
# A tibble: 1 × 6
monkey starting_items operation test if_true if_false
<chr> <list> <chr> <dbl> <dbl> <dbl>
1 4 <int [1]> old + 1 17 0 1
[[6]]
# A tibble: 1 × 6
monkey starting_items operation test if_true if_false
<chr> <list> <chr> <dbl> <dbl> <dbl>
1 5 <int [4]> old + 4 13 4 3
[[7]]
# A tibble: 1 × 6
monkey starting_items operation test if_true if_false
<chr> <list> <chr> <dbl> <dbl> <dbl>
1 6 <int [8]> old + 2 3 2 7
[[8]]
# A tibble: 1 × 6
monkey starting_items operation test if_true if_false
<chr> <list> <chr> <dbl> <dbl> <dbl>
1 7 <int [2]> old * old 11 3 5
process_monkey <- function(monkeys, monkey) {
c(monkey_num, items, operation, test, if_true, if_false) %<-% monkeys[monkey][[1]]
items <- unlist(items)
print("items")
print(items)
while (length(items) > 0) {
old <- items[[length(items)]]
items <- items[1:length(items) - 1]
print("items pop")
print(items)
print("old")
print(old)
print("operation")
print(operation)
new <- eval(parse(text = operation))
print("new")
print(new)
new <- floor(new / 3)
change <- if (new %% test) if_false else if_true
print("change")
print(change)
print(monkeys[[change]]$starting_items[[1]])
monkeys[[change]]$starting_items[[1]] <- c(monkeys[[change]]$starting_items[[1]], new)
}
return(monkeys)
}
next_round <- function(monkeys) {
round_inspections <- integer(0)
for (monkey in seq_along(monkeys)) {
round_inspections <- c(round_inspections, length(monkeys[[monkey]]$starting_items[[1]]))
monkeys = process_monkey(monkeys, monkey)
}
print("round_inspections")
print(round_inspections)
return(list(monkeys = monkeys, round_inspections = round_inspections))
}
inspections <- rep(0, nrow(data))
rounds <- 2
divisor <- status %>% map_dbl(~.x[[4]]) %>% prod()
for (round in 1:rounds) {
print(paste("round", round))
result <- next_round(status)
# print(result)
# status <- result$monkeys
# round_inspections <- result$round_inspections
# inspections = [a + b for a, b in zip(inspections, round_inspections)]
}
[1] "round 1"
[1] "items"
[1] 98 89 52
[1] "items pop"
[1] 98 89
[1] "old"
[1] 52
[1] "operation"
[1] "old * 2"
[1] "new"
[1] 104
[1] "change"
[1] 1
[1] 98 89 52
[1] "items pop"
[1] 98
[1] "old"
[1] 89
[1] "operation"
[1] "old * 2"
[1] "new"
[1] 178
[1] "change"
[1] 1
[1] 98 89 52 34
[1] "items pop"
integer(0)
[1] "old"
[1] 98
[1] "operation"
[1] "old * 2"
[1] "new"
[1] 196
[1] "change"
[1] 6
[1] 94 91 51 63
[1] "items"
[1] 57 95 80 92 57 78
[1] "items pop"
[1] 57 95 80 92 57
[1] "old"
[1] 78
[1] "operation"
[1] "old * 13"
[1] "new"
[1] 1014
[1] "change"
[1] 2
[1] 57 95 80 92 57 78
[1] "items pop"
[1] 57 95 80 92
[1] "old"
[1] 57
[1] "operation"
[1] "old * 13"
[1] "new"
[1] 741
[1] "change"
[1] 6
[1] 94 91 51 63 65
[1] "items pop"
[1] 57 95 80
[1] "old"
[1] 92
[1] "operation"
[1] "old * 13"
[1] "new"
[1] 1196
[1] "change"
[1] 2
[1] 57 95 80 92 57 78 338
[1] "items pop"
[1] 57 95
[1] "old"
[1] 80
[1] "operation"
[1] "old * 13"
[1] "new"
[1] 1040
[1] "change"
[1] 2
[1] 57 95 80 92 57 78 338 398
[1] "items pop"
[1] 57
[1] "old"
[1] 95
[1] "operation"
[1] "old * 13"
[1] "new"
[1] 1235
[1] "change"
[1] 6
[1] 94 91 51 63 65 247
[1] "items pop"
integer(0)
[1] "old"
[1] 57
[1] "operation"
[1] "old * 13"
[1] "new"
[1] 741
[1] "change"
[1] 6
[1] 94 91 51 63 65 247 411
[1] "items"
[1] 82 74 97 75 51 92 83
[1] "items pop"
[1] 82 74 97 75 51 92
[1] "old"
[1] 83
[1] "operation"
[1] "old + 5"
[1] "new"
[1] 88
[1] "change"
[1] 5
[1] 63
[1] "items pop"
[1] 82 74 97 75 51
[1] "old"
[1] 92
[1] "operation"
[1] "old + 5"
[1] "new"
[1] 97
[1] "change"
[1] 5
[1] 63 29
[1] "items pop"
[1] 82 74 97 75
[1] "old"
[1] 51
[1] "operation"
[1] "old + 5"
[1] "new"
[1] 56
[1] "change"
[1] 5
[1] 63 29 32
[1] "items pop"
[1] 82 74 97
[1] "old"
[1] 75
[1] "operation"
[1] "old + 5"
[1] "new"
[1] 80
[1] "change"
[1] 5
[1] 63 29 32 18
[1] "items pop"
[1] 82 74
[1] "old"
[1] 97
[1] "operation"
[1] "old + 5"
[1] "new"
[1] 102
[1] "change"
[1] 5
[1] 63 29 32 18 26
[1] "items pop"
[1] 82
[1] "old"
[1] 74
[1] "operation"
[1] "old + 5"
[1] "new"
[1] 79
[1] "change"
[1] 5
[1] 63 29 32 18 26 34
[1] "items pop"
integer(0)
[1] "old"
[1] 82
[1] "operation"
[1] "old + 5"
[1] "new"
[1] 87
[1] "change"
[1] 5
[1] 63 29 32 18 26 34 26
[1] "items"
[1] 97 88 51 68 76
[1] "items pop"
[1] 97 88 51 68
[1] "old"
[1] 76
[1] "operation"
[1] "old + 6"
[1] "new"
[1] 82
[1] "change"
[1] 4
[1] 97 88 51 68 76
[1] "items pop"
[1] 97 88 51
[1] "old"
[1] 68
[1] "operation"
[1] "old + 6"
[1] "new"
[1] 74
[1] "change"
[1] 4
[1] 97 88 51 68 76 27
[1] "items pop"
[1] 97 88
[1] "old"
[1] 51
[1] "operation"
[1] "old + 6"
[1] "new"
[1] 57
[1] "change"
[1] 4
[1] 97 88 51 68 76 27 24
[1] "items pop"
[1] 97
[1] "old"
[1] 88
[1] "operation"
[1] "old + 6"
[1] "new"
[1] 94
[1] "change"
[1] 4
[1] 97 88 51 68 76 27 24 19
[1] "items pop"
integer(0)
[1] "old"
[1] 97
[1] "operation"
[1] "old + 6"
[1] "new"
[1] 103
[1] "change"
[1] 4
[1] 97 88 51 68 76 27 24 19 31
[1] "items"
[1] 63 29 32 18 26 34 26 29
[1] "items pop"
[1] 63 29 32 18 26 34 26
[1] "old"
[1] 29
[1] "operation"
[1] "old + 1"
[1] "new"
[1] 30
[1] "change"
[1] 1
[1] 98 89 52 34 59
[1] "items pop"
[1] 63 29 32 18 26 34
[1] "old"
[1] 26
[1] "operation"
[1] "old + 1"
[1] "new"
[1] 27
[1] "change"
[1] 1
[1] 98 89 52 34 59 10
[1] "items pop"
[1] 63 29 32 18 26
[1] "old"
[1] 34
[1] "operation"
[1] "old + 1"
[1] "new"
[1] 35
[1] "change"
[1] 1
[1] 98 89 52 34 59 10 9
[1] "items pop"
[1] 63 29 32 18
[1] "old"
[1] 26
[1] "operation"
[1] "old + 1"
[1] "new"
[1] 27
[1] "change"
[1] 1
[1] 98 89 52 34 59 10 9 11
[1] "items pop"
[1] 63 29 32
[1] "old"
[1] 18
[1] "operation"
[1] "old + 1"
[1] "new"
[1] 19
[1] "change"
[1] 1
[1] 98 89 52 34 59 10 9 11 9
[1] "items pop"
[1] 63 29
[1] "old"
[1] 32
[1] "operation"
[1] "old + 1"
[1] "new"
[1] 33
[1] "change"
[1] 1
[1] 98 89 52 34 59 10 9 11 9 6
[1] "items pop"
[1] 63
[1] "old"
[1] 29
[1] "operation"
[1] "old + 1"
[1] "new"
[1] 30
[1] "change"
[1] 1
[1] 98 89 52 34 59 10 9 11 9 6 11
[1] "items pop"
numeric(0)
[1] "old"
[1] 63
[1] "operation"
[1] "old + 1"
[1] "new"
[1] 64
[1] "change"
[1] 1
[1] 98 89 52 34 59 10 9 11 9 6 11 10
[1] "items"
[1] 94 91 51 63 65 247 411 247
[1] "items pop"
[1] 94 91 51 63 65 247 411
[1] "old"
[1] 247
[1] "operation"
[1] "old + 4"
[1] "new"
[1] 251
[1] "change"
[1] 3
[1] 82 74 97 75 51 92 83
[1] "items pop"
[1] 94 91 51 63 65 247
[1] "old"
[1] 411
[1] "operation"
[1] "old + 4"
[1] "new"
[1] 415
[1] "change"
[1] 3
[1] 82 74 97 75 51 92 83 83
[1] "items pop"
[1] 94 91 51 63 65
[1] "old"
[1] 247
[1] "operation"
[1] "old + 4"
[1] "new"
[1] 251
[1] "change"
[1] 3
[1] 82 74 97 75 51 92 83 83 138
[1] "items pop"
[1] 94 91 51 63
[1] "old"
[1] 65
[1] "operation"
[1] "old + 4"
[1] "new"
[1] 69
[1] "change"
[1] 3
[1] 82 74 97 75 51 92 83 83 138 83
[1] "items pop"
[1] 94 91 51
[1] "old"
[1] 63
[1] "operation"
[1] "old + 4"
[1] "new"
[1] 67
[1] "change"
[1] 3
[1] 82 74 97 75 51 92 83 83 138 83 23
[1] "items pop"
[1] 94 91
[1] "old"
[1] 51
[1] "operation"
[1] "old + 4"
[1] "new"
[1] 55
[1] "change"
[1] 3
[1] 82 74 97 75 51 92 83 83 138 83 23 22
[1] "items pop"
[1] 94
[1] "old"
[1] 91
[1] "operation"
[1] "old + 4"
[1] "new"
[1] 95
[1] "change"
[1] 3
[1] 82 74 97 75 51 92 83 83 138 83 23 22 18
[1] "items pop"
numeric(0)
[1] "old"
[1] 94
[1] "operation"
[1] "old + 4"
[1] "new"
[1] 98
[1] "change"
[1] 3
[1] 82 74 97 75 51 92 83 83 138 83 23 22 18 31
[1] "items"
[1] 61 54 94 71 74 68 98 83
[1] "items pop"
[1] 61 54 94 71 74 68 98
[1] "old"
[1] 83
[1] "operation"
[1] "old + 2"
[1] "new"
[1] 85
[1] "change"
[1] 7
[1] 61 54 94 71 74 68 98 83
[1] "items pop"
[1] 61 54 94 71 74 68
[1] "old"
[1] 98
[1] "operation"
[1] "old + 2"
[1] "new"
[1] 100
[1] "change"
[1] 2
[1] 57 95 80 92 57 78 338 398 346
[1] "items pop"
[1] 61 54 94 71 74
[1] "old"
[1] 68
[1] "operation"
[1] "old + 2"
[1] "new"
[1] 70
[1] "change"
[1] 7
[1] 61 54 94 71 74 68 98 83 28
[1] "items pop"
[1] 61 54 94 71
[1] "old"
[1] 74
[1] "operation"
[1] "old + 2"
[1] "new"
[1] 76
[1] "change"
[1] 7
[1] 61 54 94 71 74 68 98 83 28 23
[1] "items pop"
[1] 61 54 94
[1] "old"
[1] 71
[1] "operation"
[1] "old + 2"
[1] "new"
[1] 73
[1] "change"
[1] 2
[1] 57 95 80 92 57 78 338 398 346 33
[1] "items pop"
[1] 61 54
[1] "old"
[1] 94
[1] "operation"
[1] "old + 2"
[1] "new"
[1] 96
[1] "change"
[1] 7
[1] 61 54 94 71 74 68 98 83 28 23 25
[1] "items pop"
[1] 61
[1] "old"
[1] 54
[1] "operation"
[1] "old + 2"
[1] "new"
[1] 56
[1] "change"
[1] 2
[1] 57 95 80 92 57 78 338 398 346 33 24
[1] "items pop"
integer(0)
[1] "old"
[1] 61
[1] "operation"
[1] "old + 2"
[1] "new"
[1] 63
[1] "change"
[1] 2
[1] 57 95 80 92 57 78 338 398 346 33 24 18
[1] "items"
[1] 90 56
[1] "items pop"
[1] 90
[1] "old"
[1] 56
[1] "operation"
[1] "old * old"
[1] "new"
[1] 3136
[1] "change"
[1] 3
[1] 82 74 97 75 51 92 83 83 138 83 23 22 18 31 32
[1] "items pop"
integer(0)
[1] "old"
[1] 90
[1] "operation"
[1] "old * old"
[1] "new"
[1] 8100
[1] "change"
[1] 5
[1] 63 29 32 18 26 34 26 29
[1] "round_inspections"
[1] 3 6 7 5 8 8 8 2
[1] "round 2"
[1] "items"
[1] 98 89 52
[1] "items pop"
[1] 98 89
[1] "old"
[1] 52
[1] "operation"
[1] "old * 2"
[1] "new"
[1] 104
[1] "change"
[1] 1
[1] 98 89 52
[1] "items pop"
[1] 98
[1] "old"
[1] 89
[1] "operation"
[1] "old * 2"
[1] "new"
[1] 178
[1] "change"
[1] 1
[1] 98 89 52 34
[1] "items pop"
integer(0)
[1] "old"
[1] 98
[1] "operation"
[1] "old * 2"
[1] "new"
[1] 196
[1] "change"
[1] 6
[1] 94 91 51 63
[1] "items"
[1] 57 95 80 92 57 78
[1] "items pop"
[1] 57 95 80 92 57
[1] "old"
[1] 78
[1] "operation"
[1] "old * 13"
[1] "new"
[1] 1014
[1] "change"
[1] 2
[1] 57 95 80 92 57 78
[1] "items pop"
[1] 57 95 80 92
[1] "old"
[1] 57
[1] "operation"
[1] "old * 13"
[1] "new"
[1] 741
[1] "change"
[1] 6
[1] 94 91 51 63 65
[1] "items pop"
[1] 57 95 80
[1] "old"
[1] 92
[1] "operation"
[1] "old * 13"
[1] "new"
[1] 1196
[1] "change"
[1] 2
[1] 57 95 80 92 57 78 338
[1] "items pop"
[1] 57 95
[1] "old"
[1] 80
[1] "operation"
[1] "old * 13"
[1] "new"
[1] 1040
[1] "change"
[1] 2
[1] 57 95 80 92 57 78 338 398
[1] "items pop"
[1] 57
[1] "old"
[1] 95
[1] "operation"
[1] "old * 13"
[1] "new"
[1] 1235
[1] "change"
[1] 6
[1] 94 91 51 63 65 247
[1] "items pop"
integer(0)
[1] "old"
[1] 57
[1] "operation"
[1] "old * 13"
[1] "new"
[1] 741
[1] "change"
[1] 6
[1] 94 91 51 63 65 247 411
[1] "items"
[1] 82 74 97 75 51 92 83
[1] "items pop"
[1] 82 74 97 75 51 92
[1] "old"
[1] 83
[1] "operation"
[1] "old + 5"
[1] "new"
[1] 88
[1] "change"
[1] 5
[1] 63
[1] "items pop"
[1] 82 74 97 75 51
[1] "old"
[1] 92
[1] "operation"
[1] "old + 5"
[1] "new"
[1] 97
[1] "change"
[1] 5
[1] 63 29
[1] "items pop"
[1] 82 74 97 75
[1] "old"
[1] 51
[1] "operation"
[1] "old + 5"
[1] "new"
[1] 56
[1] "change"
[1] 5
[1] 63 29 32
[1] "items pop"
[1] 82 74 97
[1] "old"
[1] 75
[1] "operation"
[1] "old + 5"
[1] "new"
[1] 80
[1] "change"
[1] 5
[1] 63 29 32 18
[1] "items pop"
[1] 82 74
[1] "old"
[1] 97
[1] "operation"
[1] "old + 5"
[1] "new"
[1] 102
[1] "change"
[1] 5
[1] 63 29 32 18 26
[1] "items pop"
[1] 82
[1] "old"
[1] 74
[1] "operation"
[1] "old + 5"
[1] "new"
[1] 79
[1] "change"
[1] 5
[1] 63 29 32 18 26 34
[1] "items pop"
integer(0)
[1] "old"
[1] 82
[1] "operation"
[1] "old + 5"
[1] "new"
[1] 87
[1] "change"
[1] 5
[1] 63 29 32 18 26 34 26
[1] "items"
[1] 97 88 51 68 76
[1] "items pop"
[1] 97 88 51 68
[1] "old"
[1] 76
[1] "operation"
[1] "old + 6"
[1] "new"
[1] 82
[1] "change"
[1] 4
[1] 97 88 51 68 76
[1] "items pop"
[1] 97 88 51
[1] "old"
[1] 68
[1] "operation"
[1] "old + 6"
[1] "new"
[1] 74
[1] "change"
[1] 4
[1] 97 88 51 68 76 27
[1] "items pop"
[1] 97 88
[1] "old"
[1] 51
[1] "operation"
[1] "old + 6"
[1] "new"
[1] 57
[1] "change"
[1] 4
[1] 97 88 51 68 76 27 24
[1] "items pop"
[1] 97
[1] "old"
[1] 88
[1] "operation"
[1] "old + 6"
[1] "new"
[1] 94
[1] "change"
[1] 4
[1] 97 88 51 68 76 27 24 19
[1] "items pop"
integer(0)
[1] "old"
[1] 97
[1] "operation"
[1] "old + 6"
[1] "new"
[1] 103
[1] "change"
[1] 4
[1] 97 88 51 68 76 27 24 19 31
[1] "items"
[1] 63 29 32 18 26 34 26 29
[1] "items pop"
[1] 63 29 32 18 26 34 26
[1] "old"
[1] 29
[1] "operation"
[1] "old + 1"
[1] "new"
[1] 30
[1] "change"
[1] 1
[1] 98 89 52 34 59
[1] "items pop"
[1] 63 29 32 18 26 34
[1] "old"
[1] 26
[1] "operation"
[1] "old + 1"
[1] "new"
[1] 27
[1] "change"
[1] 1
[1] 98 89 52 34 59 10
[1] "items pop"
[1] 63 29 32 18 26
[1] "old"
[1] 34
[1] "operation"
[1] "old + 1"
[1] "new"
[1] 35
[1] "change"
[1] 1
[1] 98 89 52 34 59 10 9
[1] "items pop"
[1] 63 29 32 18
[1] "old"
[1] 26
[1] "operation"
[1] "old + 1"
[1] "new"
[1] 27
[1] "change"
[1] 1
[1] 98 89 52 34 59 10 9 11
[1] "items pop"
[1] 63 29 32
[1] "old"
[1] 18
[1] "operation"
[1] "old + 1"
[1] "new"
[1] 19
[1] "change"
[1] 1
[1] 98 89 52 34 59 10 9 11 9
[1] "items pop"
[1] 63 29
[1] "old"
[1] 32
[1] "operation"
[1] "old + 1"
[1] "new"
[1] 33
[1] "change"
[1] 1
[1] 98 89 52 34 59 10 9 11 9 6
[1] "items pop"
[1] 63
[1] "old"
[1] 29
[1] "operation"
[1] "old + 1"
[1] "new"
[1] 30
[1] "change"
[1] 1
[1] 98 89 52 34 59 10 9 11 9 6 11
[1] "items pop"
numeric(0)
[1] "old"
[1] 63
[1] "operation"
[1] "old + 1"
[1] "new"
[1] 64
[1] "change"
[1] 1
[1] 98 89 52 34 59 10 9 11 9 6 11 10
[1] "items"
[1] 94 91 51 63 65 247 411 247
[1] "items pop"
[1] 94 91 51 63 65 247 411
[1] "old"
[1] 247
[1] "operation"
[1] "old + 4"
[1] "new"
[1] 251
[1] "change"
[1] 3
[1] 82 74 97 75 51 92 83
[1] "items pop"
[1] 94 91 51 63 65 247
[1] "old"
[1] 411
[1] "operation"
[1] "old + 4"
[1] "new"
[1] 415
[1] "change"
[1] 3
[1] 82 74 97 75 51 92 83 83
[1] "items pop"
[1] 94 91 51 63 65
[1] "old"
[1] 247
[1] "operation"
[1] "old + 4"
[1] "new"
[1] 251
[1] "change"
[1] 3
[1] 82 74 97 75 51 92 83 83 138
[1] "items pop"
[1] 94 91 51 63
[1] "old"
[1] 65
[1] "operation"
[1] "old + 4"
[1] "new"
[1] 69
[1] "change"
[1] 3
[1] 82 74 97 75 51 92 83 83 138 83
[1] "items pop"
[1] 94 91 51
[1] "old"
[1] 63
[1] "operation"
[1] "old + 4"
[1] "new"
[1] 67
[1] "change"
[1] 3
[1] 82 74 97 75 51 92 83 83 138 83 23
[1] "items pop"
[1] 94 91
[1] "old"
[1] 51
[1] "operation"
[1] "old + 4"
[1] "new"
[1] 55
[1] "change"
[1] 3
[1] 82 74 97 75 51 92 83 83 138 83 23 22
[1] "items pop"
[1] 94
[1] "old"
[1] 91
[1] "operation"
[1] "old + 4"
[1] "new"
[1] 95
[1] "change"
[1] 3
[1] 82 74 97 75 51 92 83 83 138 83 23 22 18
[1] "items pop"
numeric(0)
[1] "old"
[1] 94
[1] "operation"
[1] "old + 4"
[1] "new"
[1] 98
[1] "change"
[1] 3
[1] 82 74 97 75 51 92 83 83 138 83 23 22 18 31
[1] "items"
[1] 61 54 94 71 74 68 98 83
[1] "items pop"
[1] 61 54 94 71 74 68 98
[1] "old"
[1] 83
[1] "operation"
[1] "old + 2"
[1] "new"
[1] 85
[1] "change"
[1] 7
[1] 61 54 94 71 74 68 98 83
[1] "items pop"
[1] 61 54 94 71 74 68
[1] "old"
[1] 98
[1] "operation"
[1] "old + 2"
[1] "new"
[1] 100
[1] "change"
[1] 2
[1] 57 95 80 92 57 78 338 398 346
[1] "items pop"
[1] 61 54 94 71 74
[1] "old"
[1] 68
[1] "operation"
[1] "old + 2"
[1] "new"
[1] 70
[1] "change"
[1] 7
[1] 61 54 94 71 74 68 98 83 28
[1] "items pop"
[1] 61 54 94 71
[1] "old"
[1] 74
[1] "operation"
[1] "old + 2"
[1] "new"
[1] 76
[1] "change"
[1] 7
[1] 61 54 94 71 74 68 98 83 28 23
[1] "items pop"
[1] 61 54 94
[1] "old"
[1] 71
[1] "operation"
[1] "old + 2"
[1] "new"
[1] 73
[1] "change"
[1] 2
[1] 57 95 80 92 57 78 338 398 346 33
[1] "items pop"
[1] 61 54
[1] "old"
[1] 94
[1] "operation"
[1] "old + 2"
[1] "new"
[1] 96
[1] "change"
[1] 7
[1] 61 54 94 71 74 68 98 83 28 23 25
[1] "items pop"
[1] 61
[1] "old"
[1] 54
[1] "operation"
[1] "old + 2"
[1] "new"
[1] 56
[1] "change"
[1] 2
[1] 57 95 80 92 57 78 338 398 346 33 24
[1] "items pop"
integer(0)
[1] "old"
[1] 61
[1] "operation"
[1] "old + 2"
[1] "new"
[1] 63
[1] "change"
[1] 2
[1] 57 95 80 92 57 78 338 398 346 33 24 18
[1] "items"
[1] 90 56
[1] "items pop"
[1] 90
[1] "old"
[1] 56
[1] "operation"
[1] "old * old"
[1] "new"
[1] 3136
[1] "change"
[1] 3
[1] 82 74 97 75 51 92 83 83 138 83 23 22 18 31 32
[1] "items pop"
integer(0)
[1] "old"
[1] 90
[1] "operation"
[1] "old * old"
[1] "new"
[1] 8100
[1] "change"
[1] 5
[1] 63 29 32 18 26 34 26 29
[1] "round_inspections"
[1] 3 6 7 5 8 8 8 2
# prod(sorted(inspections)[-2:])