Joao Neto's Avatar

Joao Neto

@joaopneto

Talks about tech, product management, data and other geek stuff. Loves surfing, mountain biking and great books.

42
Followers
85
Following
50
Posts
21.10.2024
Joined
Posts Following

Latest posts by Joao Neto @joaopneto

Stylish! ๐Ÿ˜Ž

27.03.2025 13:41 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

Fun fact: The cache hit rate is consistently over 65% per design, but it can reach into the 90s in some cases.

19.12.2024 11:23 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

I just completed "Linen Layout" - Day 19 - Advent of Code 2024 #AdventOfCode adventofcode.com/2024/day/19

Part1 was trivial. Part2, I went in circles debugging the stop conditions of my recursion only to realize the solution space was huge. Used python's caching decorator (functools.lru_cache)

19.12.2024 11:14 ๐Ÿ‘ 4 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

Meant 3-bit computer (0 to 7 decimal).

"This seems to be a 3-bit computer: its program is a list of 3-bit numbers (0 through 7), like 0,1,2,3. The computer also has three registers named A, B, and C, but these registers aren't limited to 3 bits and can instead hold any integer."

18.12.2024 20:35 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

The 7-bit computer hint means outputs depend only on the lower 3 bits of registers at each step. I built A incrementally, testing just 8 values (0-7) for each 3-bit chunk, which massively reduced the search space.

18.12.2024 19:18 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

Managed to solve it with the hint that this is a 7-bit computer, so this can dramatically reduce the search space.

Here is my program:
Program: 2,4,1,5,7,5,4,3,1,6,0,3,5,5,3,0

18.12.2024 11:39 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

I just completed "RAM Run" - Day 18 - Advent of Code 2024 #AdventOfCode adventofcode.com/2024/day/18

Not quite sure why this one was so easy. Re-used my Dijkstra's search from Day 16. Part2 was just simple iteration.

18.12.2024 11:35 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

Yep. Figured that later. ๐Ÿ˜…

18.12.2024 09:03 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
Day 17 - Advent of Code 2024

I just completed "Chronospatial Computer" - Day 17 - Advent of Code 2024 #AdventOfCode adventofcode.com/2024/day/17

Part1 was fun.
Part2, tried to brute force a sequencial search with early exit.
Didn't work.
Tried caching.
Didn't work.
Finally got it after re-reading the entire (hint!) puzzle.

17.12.2024 15:09 ๐Ÿ‘ 4 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

Thanks! You just saved me a couple billions of linear searching. ๐Ÿ˜…

17.12.2024 14:07 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
Post image

The drop rate on #AventofCode is quite something.

16.12.2024 13:25 ๐Ÿ‘ 3 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

I imagine it should be possible with some prunning heuristics on score and possibly distance to the objective, but I don't think my laptop would get there. Running BFS took 10min for part2, I was starting to wonder if it would produce a result during my lifetime. ๐Ÿ˜…

16.12.2024 13:19 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

Yep. Tried that.

16.12.2024 12:11 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
Day 16 - Advent of Code 2024

I just completed "Reindeer Maze" - Day 16 - Advent of Code 2024 #AdventOfCode adventofcode.com/2024/day/16

Not getting any easier. Part1, failed miserably going depth-first, and had to call upon our friend Dijkstra with a priority heap queue. Part2 took like 10 min to compute. ๐Ÿซข

16.12.2024 12:08 ๐Ÿ‘ 3 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Video thumbnail

#Surfskating in Cascais today

15.12.2024 23:08 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

Sure! I'll give you a hint. I created a simple function that scores the position of the bots according to their proximity to other bots. Let me know if you need more details!

14.12.2024 15:31 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

That could work but there are much simpler and cheaper solutions, like scoring how close bots are to each other.

14.12.2024 13:22 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

Oh wow! That's "creative" ๐Ÿ˜…

14.12.2024 13:13 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

I solved it on paper first. It's really just a simple system of two linear equations with two unknown variables, so it has only one possible solution.

14.12.2024 13:10 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

I just completed "Restroom Redoubt" - Day 14 - Advent of Code 2024 #AdventOfCode adventofcode.com/2024/day/14

This was super fun to solve. For part2 I first tried to visualize a time-lapse but that took way too long. Had to come up with a clustering heuristic that did the trick!

14.12.2024 11:17 ๐Ÿ‘ 4 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Day 13 - Advent of Code 2024

I just completed "Claw Contraption" - Day 13 - Advent of Code 2024 #AdventOfCode adventofcode.com/2024/day/13

So proud of myself! It's the first time I do part2 in seconds because I made smart choices in part1 by choosing not to brute force.

13.12.2024 11:46 ๐Ÿ‘ 3 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

I just completed "Garden Groups" - Day 12 - Advent of Code 2024 #AdventOfCode adventofcode.com/2024/day/12

Took me a while to get part2 logic nailed - and finally it was working in all examples, but failing for the input ๐Ÿคฏ. Very painful. I think I got garden fencing PTSD now.

12.12.2024 14:27 ๐Ÿ‘ 7 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
Post image

This is what we call "December" around here

12.12.2024 07:55 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

Love the ballanced and sober position. Looking forward to that engineer-to-engineer sharing and learning.

12.12.2024 07:51 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

I just completed "Plutonian Pebbles" - Day 11 - Advent of Code 2024 #AdventOfCode adventofcode.com/2024/day/11

This one was super fun! Got part1 in less than 20min, but no amount of optimization would work for part2. Had to come with a completely new strategy, and that took a while!

11.12.2024 11:00 ๐Ÿ‘ 4 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

I just completed "Hoof It" - Day 10 - Advent of Code 2024 #AdventOfCode adventofcode.com/2024/day/10

Part2 made me sweat quite a bit. Troubleshooting recursion on very large inputs was not fun.

10.12.2024 13:13 ๐Ÿ‘ 4 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Day 9 - Advent of Code 2024

I just completed "Disk Fragmenter" - Day 9 - Advent of Code 2024 #AdventOfCode adventofcode.com/2024/day/9

09.12.2024 14:02 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

I just completed "Resonant Collinearity" - Day 8 - Advent of Code 2024 #AdventOfCode adventofcode.com/2024/day/8

Lesson of the day: Python does "short-circuit evaluation" for boolean expressions. Using "|" instead of "or" did the trick.

08.12.2024 20:32 ๐Ÿ‘ 3 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

I just completed "Bridge Repair" - Day 7 - Advent of Code 2024 #AdventOfCode adventofcode.com/2024/day/7

Lesson of the day: never use mutable data structures in recursive functions. ๐Ÿคฆโ€โ™‚๏ธ

07.12.2024 14:40 ๐Ÿ‘ 3 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Day 6 - Advent of Code 2024

I just completed "Guard Gallivant" - Day 6 - Advent of Code 2024 #AdventOfCode adventofcode.com/2024/day/6

Learned a very humbling lesson about the difference between deepcopy and shallowcopy in python. ๐Ÿซ 

06.12.2024 13:45 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0