set.seed(15)
my_char <- paste(sample(letters, 5000, replace = T), 
                 collapse = '')

my_split <- str_split(my_char, pattern = 'b')[[1]]

# find number of characters in each
n_chars <- sapply(my_split, nchar)

# solution
my_sol <- n_chars[which.max(n_chars)]
my_answers <- make_random_answers(my_sol)

#check_answers(my_answers)

Question

Based on the my_char object created earlier, if we divided it into several smaller pieces using the letter "b", what is the number of characters in the largest piece found?

exams::answerlist(my_answers, markup = "markdown")

Solution


Meta-information

extype: num exsolution: r my_sol exname: "numeric " exshuffle: TRUE



msperlin/afedR documentation built on Sept. 11, 2022, 9:49 a.m.