José Valim Solves the Hardest Day Yet with Elixir! (José Valim's Advent of Code Day 3)

preview_player
Показать описание
José and Twitch Chat solves the hardest day of Advent of Code (so far)! Check out how you can solve this problem with Elixir and LiveBook! Subscribe to stay tuned for the next ones.

José makes surprisingly good thumbnail faces. None of which were on purpose.

I intentionally excluded the Nx solutions since it's experimental and dense with explanations (they deserve their own video!). I will upload a separate video for the Nx solutions.

00:00 - José on the stream summaries
00:23 - Introduction
00:47 - Creating a new notebook
00:51 - AoC introduction
00:57 - Part 1: Problem reading
01:53 - Using sample input
01:57 - New LiveBook feature: Intellisense
02:22 - Strategizing
02:35 - Parsing input
06:30 - Using bitwise not
06:51 - Bitwise masking
07:00 - Twitch chat on input data
07:36 - Remarks on current strategy
08:27 - Installing Kino. Congrats on 0.4.0 release! 💜
08:49 - Setting up LiveBook textarea
09:08 - Reading textarea input with Kino
09:29 - Refactoring code for longer binary input
10:25 - Elixir 1.13 has a power operator!
10:45 - Computing for the new mask
12:02 - Automatically reevaluate LiveBook cell
12:18 - Submitting answer for part 1
12:19 - Twitch chat asks about bitwise shift
12:38 - Remarks on part 1 solution
12:48 - Twitch chat on if bitwise is necessary for this
13:05 - Part 2: Problem reading
14:39 - Refactoring to use recursion
15:28 - Refactoring to use recursion cont.
17:03 - Writing the solution
18:43 - Twitch chat helps José
19:22 - Writing the solution cont.
22:41 - Twitch chat helps José again
22:59 - Another one
23:10 - Writing the solution cont.
24:28 - José thanks Twitch chat
24:33 - Refactoring woes
25:08 - Submitting answer for part 2

Outro Music
Title: You and Me

#AdventOfCode2021 #AdventOfCode #Elixir
Рекомендации по теме
Комментарии
Автор

I know I'm late, but I've been learning elixir and working through these. It's amazing watching someone deeply familiar with the language fly through these problems.

It's probably not super efficient, but my solution was to transpose the list of bit strings into one list per column, and then use Enum.frequencies on each one. The count_until is so handy though.

Thank you so much for making these!

ftheWALLS