Skip to content

Instantly share code, notes, and snippets.

@bschneidr
Created December 2, 2024 23:44
Show Gist options
  • Save bschneidr/5051ee39ba40966d66550270d8270989 to your computer and use it in GitHub Desktop.
Save bschneidr/5051ee39ba40966d66550270d8270989 to your computer and use it in GitHub Desktop.
read.table("day-1/input", col.names = c("list_1", "list_2")) |>
apply(MARGIN = 2, sort) |>
apply(MARGIN = 1, FUN = \(x) abs(x[2] - x[1])) |>
sum()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment