library(mistlecode) dt <- readLines("input.txt") |> str_split("") |> map(~ data.frame(t(.x))) |> bind_rows()
omg. This is gonna be so easy.
Edit: it was!
dt |> map_chr(\(x) { x |> table() |> sort(decreasing = TRUE) |> head(1) |> names() }) |> paste0(collapse = "")
[1] "bjosfbce"
Classic. Just drop decreasing = TRUE.
decreasing = TRUE
dt |> map_chr(\(x) { x |> table() |> sort() |> head(1) |> names() }) |> paste0(collapse = "")
[1] "veqfxzfx"