Advertisement ยท 728 ร— 90

Posts by Joao Neto

Stylish! ๐Ÿ˜Ž

1 year ago 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.

1 year ago 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)

1 year ago 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."

1 year ago 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.

1 year ago 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

1 year ago 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.

1 year ago 1 0 0 0

Yep. Figured that later. ๐Ÿ˜…

1 year ago 1 0 1 0
Advertisement
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.

1 year ago 4 0 0 0

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

1 year ago 1 0 1 0
Post image

The drop rate on #AventofCode is quite something.

1 year ago 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. ๐Ÿ˜…

1 year ago 1 0 1 0

Yep. Tried that.

1 year ago 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. ๐Ÿซข

1 year ago 3 0 0 0
Video

#Surfskating in Cascais today

1 year ago 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!

1 year ago 1 0 1 0

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

1 year ago 0 0 1 0

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

1 year ago 1 0 1 0
Advertisement

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.

1 year ago 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!

1 year ago 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.

1 year ago 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.

1 year ago 7 0 1 0
Post image

This is what we call "December" around here

1 year ago 2 0 0 0

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

1 year ago 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!

1 year ago 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.

1 year ago 4 0 0 0
Advertisement
Day 9 - Advent of Code 2024

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

1 year ago 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.

1 year ago 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. ๐Ÿคฆโ€โ™‚๏ธ

1 year ago 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. ๐Ÿซ 

1 year ago 1 0 0 0