mathsppblog Profile Banner
Rodrigo πŸπŸš€ Profile
Rodrigo πŸπŸš€

@mathsppblog

Followers
42K
Following
41K
Media
3K
Statuses
18K

Advent of Code πŸ§‘β€πŸ’» live-stream https://t.co/qc9DDQHs7N

πŸπŸš€ Free Python book πŸ‘‰
Joined July 2020
Don't wanna be here? Send us removal request.
@mathsppblog
Rodrigo πŸπŸš€
1 year
We did it! Largest computer programming lesson in the world!
29
8
195
@mathsppblog
Rodrigo πŸπŸš€
18 hours
Advent of Code is over (only 12 days this year) and I'm kind of sad I don't have a reason to stream today. I liked streaming! What if I wanted to stream more? What should I stream about?
2
1
3
@anze3db
Anže Pečar
2 days
I've finished #adventofcode 2025 and this is the first year that I managed to get all solutions under 100ms ⚑ All but two are under 10ms. Not bad for the slowest popular language out there 🐍, although I did have to use numpy a few times.
1
2
11
@mathsppblog
Rodrigo πŸπŸš€
3 days
It's so ANNOYING to break out of nested loops. Auxiliary variables, conditional statements, non-linear paths through your code... It's a mess! But if you extract the looping logic to a generator, you get: - less indentation ✨ - a flat loop you can easily break out of ✨
2
0
9
@mathsppblog
Rodrigo πŸπŸš€
4 days
Mind you, this is someone who opened 86 out of my last 88 emails and who's been getting my emails for ~ 2 years. Do I _really_ sound/look like a scammer? It's a bit worrying πŸ€£πŸ˜…
1
0
2
@mathsppblog
Rodrigo πŸπŸš€
4 days
πŸ“’ Public service announcement: Don't buy from me: Don't buy my books. Don't sign-up for my courses. Don't attend my cohorts. Apparently, I'm a scammer. 🀷 At least, that's my interpretation of this comment from a subscriber... Should I delete them from my mailing list?
5
0
3
@mathsppblog
Rodrigo πŸπŸš€
4 days
After yesterday's flop, today I'm live streaming to solve day 10 and hopefully go back to day 9 part 2 to make progress on finishing it!
0
0
2
@mathsppblog
Rodrigo πŸπŸš€
6 days
A visualisation of day 7 from Advent of Code. Worked on this during yesterday's stream, although the colouring was added off stream.
0
2
4
@mathsppblog
Rodrigo πŸπŸš€
7 days
7 days of Advent of Code diagrams from my streams and analysis sessions!
0
1
6
@mathsppblog
Rodrigo πŸπŸš€
7 days
Today was a fun Advent of Code problem! Join me at 5pm UTC (in ~2h40min) as I livestream my solution and a visualisation for today's part 2. We'll be implementing a very efficient Python solution with sets and counters! The link is in my profile/bio!
1
0
3
@mathsppblog
Rodrigo πŸπŸš€
8 days
If you want to tune in for the livestream, the link is in my profile πŸ™
0
0
0
@mathsppblog
Rodrigo πŸπŸš€
8 days
Advent of Code doesn't rest during the weekend and neither do I! In ~3 hours (@ 5pm UTC) I will be livestreaming my solution for day 6. We'll also go back to day 5 to implement the MOST efficient ⚑️ solution for day 5, since my solution from yesterday was kinda inefficient. 🐌
1
0
1
@mathsppblog
Rodrigo πŸπŸš€
9 days
I need ideas. Later today (in ~2 hours) I'm going to be livestreaming while I solve Advent of Code day 5. I want to livestream for ~1h. But the problem won't be long enough. What should I do after, along a similar theme?
0
0
2
@mathsppblog
Rodrigo πŸπŸš€
10 days
πŸ”΄ I'm going live in 30 minutes to solve Advent of Code day 4. I'm sure we'll have some time left, so we'll also work on a visualisation for day 4. The link is in the bio; see you in 30!
0
0
2
@mathsppblog
Rodrigo πŸπŸš€
10 days
Anatomy of a list comprehension. Understand this and you'll never need to look up list comprehensions again.
0
0
10
@mathsppblog
Rodrigo πŸπŸš€
12 days
I'm going live to solve Advent of Code, day 2, in 10 minutes! And we'll also be going back to the visualisation for yesterday's problem... The link is in my profile :)
0
0
2
@mathsppblog
Rodrigo πŸπŸš€
12 days
To build _all_ the permutations: πŸ‘‰ go through the list of all original values πŸ‘‰ for each value, prepend it to the permutations of all the **other** values This is just an example of recursion in action... Recursion also shines when working with trees... Learn recursion! πŸš€
0
0
0
@mathsppblog
Rodrigo πŸπŸš€
12 days
This shows the recursive relation: πŸ‘‰ β€œThe **permutations** of a list of values start with the first value appended to the **permutations** of the _rest_ of the values. This is for the first permutations. To build all of them, generalise this idea to all individual values πŸ‘‡
1
0
0
@mathsppblog
Rodrigo πŸπŸš€
12 days
those triples are built by taking `0` and putting it in front of the permutations of the list `[1, 2]`: >>> from itertools import permutations >>> [(0,) + perm for perm in permutations([1, 2])] [ (0, 1, 2), (0, 2, 1), ] Interesting, right?
1
0
0
@mathsppblog
Rodrigo πŸπŸš€
12 days
Consider the permutations of the list `[0, 1, 2]`: [ (0, 1, 2), (0, 2, 1), (1, 0, 2), (1, 2, 0), (2, 0, 1), (2, 1, 0), ] The first two results are `(0, 1, 2)` and `(0, 2, 1)`, right? Now, note how
1
0
1
@mathsppblog
Rodrigo πŸπŸš€
12 days
Here's a lie developers tell themselves: β€œRecursion is useless” That's a coping mechanism because you're afraid of recursion... But you shouldn't be afraid! Recursion is actually nice ✨ And it's a very natural way to express certain algorithms... Let me show you an example.
1
1
3