Advent of Code 2023 - Day 01 - Rust

preview_player
Показать описание
First part of day 1 of solving the Advent of Code challenge. We'll read the problem and solve it in rust.

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

I think it is awesome that you are doing this. I learned Pascal a billion years ago. 😂

cptdebbie
Автор

Well since you asked. I'm writing rust for the first time and just wanted to see what someone elses solution might be. Solution is somewhat similar, iterating through each char one at a time. However, instead of doing forward + reverse on part 2 (I did on part 1), I'm just setting first the first time I see something like it, then I just *always* set last. So that it's correct once I've iterated through the entire string. I saw they were never really long, so just continuing iterating through it seemed fine. I did not know about the `is_digit()`, `is_ascii()` tests on char, nor did I think of just doing `first * 10 + last` (facepalm). So that was nice. :)

odinu
Автор

Great video! Side question, do you have a description of your shell setup? Is that tmux and fish? Also, those ls commands look really sweet, how did you do that? Thanks! Keep up with the great videos 🙂

fabiomargaglia
Автор

This video was great, although I have 0 idea of how the rust programming language works and am currently learning JS as my first language, watching you work through and think about the problem out loud was really fun to watch and made leetcode style stuff seem less scary. After I feel like I have a decent understanding of how JS/high level programming works and work my way into a front-end job I plan to start learning a low-level language to gain a more complex understanding of how software actually works, would you recommend Rust for this as a first language?

Ballisticly
Автор

I am actually unsure whether to use Copilot or similar tools for AoC and similar challenges. On one hand it somewhat feels like cheating, but on the other hand these tools are here to stay so there is kinda no point in not using them (except for the requirement to pay and/or continuously sending data to some corporation)? Confusing times.

Gordin