Advent of code in Rust - solving day 25/2020 & day 1/2021 (Twitch Live 2022-01-10)

Subscribers:
950
Published on ● Video Link: https://www.youtube.com/watch?v=f1oLn_51cMw



Duration: 1:18:08
24 views
0


In this episode, we finally completed the last day of Advent of Code y2020!

This one was a short exercise involving some cryptographic brute forcing. Nothing too tricky, that we just solved with 2 functions and with one simple loop each.

If you know any interesting mathematical solution that would allow us to avoid the loops (or reduce the amount of brute force) please let us know!

After that we started year 2021. We had already solved exercise 1 during the xmas break so we just discussed our solution and explored a couple of alternative solutions.

Our original solution used the crate itertools:( https://docs.rs/itertools/latest/itertools/ ) and specifically the tuple_windows method ( https://docs.rs/itertools/0.10.3/itertools/trait.Itertools.html#method.tuple_windows ).

Then we explored two alternative solutions. One with building our own `Pairs` iterator and another one using the `zip()` method of iterators (https://doc.rust-lang.org/std/iter/struct.Zip.html).

We finished the episode by running some benchmarks and see that the custom iterator was the fastest solution (just slightly after itertools).

If you have any suggestion, we'd love to hear it, so please leave a comment or a create a PR!

For all the source code check out the official GitHub repo: https://github.com/lmammino/rust-advent

For seeing the next episodes live check out our Twitch channel: https://twitch.tv/loige




Other Videos By Luciano Mammino (loige)


2022-04-04🦀 Rust vs 🐍 Python: Advent of code in Rust - solving day 11/2021 (Twitch Live 2022-04-04)
2022-03-28Advent of code in Rust - solving day 10/2021 (Twitch Live 2022-03-28) with Python comparison! 🐍
2022-03-21Advent of code in Rust - solving day 8/2021 part 2 and day 9/2021 (Twitch Live 2022-03-21)
2022-03-07Advent of code in Rust - solving day 7/2021 and day 8/2021 part 1 (Twitch Live 2022-03-7)
2022-02-21Advent of code in Rust SPECIAL - solving day 6/2021 on a RASPBERRY PICO (Twitch Live 2022-02-21)
2022-02-14Advent of code in Rust - solving day 6/2021 (Twitch Live 2022-02-14)
2022-02-07Advent of code in Rust - solving day 5/2021 (Twitch Live 2022-02-07)
2022-01-31Advent of code in Rust - solving day 4/2021 (Twitch Live 2022-01-31)
2022-01-24Advent of code in Rust - solving day 3/2021 (Twitch Live 2022-01-24)
2022-01-17Advent of code in Rust - solving day 2/2021 (Twitch Live 2022-01-17)
2022-01-10Advent of code in Rust - solving day 25/2020 & day 1/2021 (Twitch Live 2022-01-10)
2021-12-13Advent of code in Rust - solving year 2020 exercise 24 part 1 (Twitch Live 2021-12-13)
2021-12-07Advent of code in Rust - solving year 2020 exercise 23 part 2 (Twitch Live 2021-12-06)
2021-11-29Advent of code in Rust - solving year 2020 exercise 23 part 1 (Twitch Live 2021-11-29)
2021-11-22Advent of code in Rust - solving year 2020 exercise 22 part 2 (Twitch Live 2021-11-22)
2021-11-15Advent of code in Rust - solving year 2020 exercise 22 part 1 (Twitch Live 2021-11-15)
2021-11-08Advent of code in Rust - solving year 2020 exercise 21 (Twitch Live 2021-11-08)
2021-11-01Advent of code in Rust - solving year 2020 exercise 20 p2 THIRD ATTEMPT (Twitch Live 2021-11-01)
2021-10-27Advent of code in Rust - solving year 2020 exercise 20 p2 SECOND ATTEMPT (Twitch Live 2021-10-26)
2021-10-26Advent of code in Rust - solving year 2020 exercise 20 p2 FIRST ATTEMPT (Twitch Live 2021-10-25)
2021-10-19Advent of code in Rust - solving year 2020 exercise 20 p1(Twitch Live 2021-10-18)



Tags:
rust
rustlang
advent of code
aoc
aoc2020
advent of code 2020
adventofcode
adventofcode2020
2020
day 24
game of life
learning rust
live coding
pair programming
mob programming
live stream
twitch
educational
iterator
fromStr
traits
coding challenge
problem solving
irl
in real life