How José Valim Solved Advent of Code 2021 with Elixir and LiveBook (José Valim's Day 1: Sonar Sweep)

preview_player
Показать описание
Check out how you can solve day 1 with Elixir and LiveBook! Subscribe to stay tuned for the next ones.

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 - Introduction
00:10 - AoC star mechanic
01:00 - Part 1: Problem reading
01:58 - Configure the notebook
02:25 - Parse input
03:39 - Pair values
04:54 - Comparing & counting values
06:24 - Setting up Kino (and debugging issues)
07:57 - Kino is installed correctly
08:00 - Debugging problem with importing Kino
08:34 - Adding textarea field
09:08 - Viewer question #1
09:44 - Submitting part 1 solution
10:00 - Viewer caveats
10:29 - Viewer question #2
10:53 - Part 2: Problem reading
11:46 - Duplicate cells?
12:13 - Solving part 2
13:01 - Viewer question #3
13:19 - Re-reading the problem
14:29 - Submitting part 2 solution

Outro Music
Title: You and Me

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

This edit is really well done. Chapter markers, the way you brought in the question he responds to - *chefkiss* Thanks so much for posting this.

joemartinez
Автор

That 's pretty useful Sekun. Good Job!

kotokarrera
Автор

You then go on to create a language for providing backend services that lacks built-in JSON support? How does that even make sense?

siyaram
Автор

This is a beginner friendly way of introdcing the language. Thanx. Just for fun tried this in javascript. Needs little more work.

const input =
`199
200
208
210
200
207
240
269
260
263`;

input
.trim()
.split("\n")
.reduce((diveCnt, no, i, arr) =>
(+no > +arr[i === 0 ? i : i - 1]) ? diveCnt + 1 : diveCnt,
0);

ng