Powered by AppSignal & Oban Pro
Would you like to see your link here? Contact us

Advent of Code 2015 Day 1 Part 1

2015_day1_part1.livemd

Advent of Code 2015 Day 1 Part 1

Mix.install([
  {:kino_aoc, "~> 0.1"}
])

Get Inputs

{:ok, puzzle_input} =
  KinoAOC.download_puzzle("2015", "1", System.fetch_env!("LB_SESSION"))

My answer

puzzle_input
|> String.codepoints()
|> then(fn directions ->
  2 * Enum.count(directions, fn d -> d == "(" end) - length(directions)
end)