rugyoga
Not the prettiest but it works
Trending in Challenges
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
Aetherus
Stuck in Part 2. My algo works for the sample input, but not the real input. Any help?
https://github.com/Aetherus/advent-of-code/blob/0bc39c89cdd8d327fac4aab63b74b828ea2b15f4/2024/day-09.livemd
bjorng
It took me a long time to find an off-by-one error in part 2. The combined runtime for both parts is 0.4 seconds.
https://github.com/bjorng/advent-of-code/blob/main/2024/day09/lib/day09.ex
Aetherus
Finally found the problem. I should not swap a file with a space behind that file.
https://github.com/Aetherus/advent-of-code/blob/178d10a0a3429953ed8fff3df1bca5b3d582e9cb/2024/day-09.livemd
lud
My solution takes 11 seconds adventofcode/lib/solutions/2024/day09.ex at main · lud/adventofcode · GitHub
I have an entry in the disk (a map) for each block. I will see if I can keep all contiguous file parts as a single map entry.
sevenseacat
I am not proud of the code I wrote today.
I totally misunderstood the part 2 problem, came up with some code that gave the right answer anyway somehow but it was too slow, so I rewrote it after actually understanding what I was supposed to do, but it was even slower, so I scratched my head a bit and then rewrote it again.
For such an innocuous-sounding puzzle, that did my head in.
https://github.com/sevenseacat/advent_of_code/blob/main/lib/y2024/day09.ex
Runtime:
Flo0807
Very slow solution today. I might come back optimizing it:
https://github.com/Flo0807/adventofcode/blob/main/2024/09.livemd
jarlah
again just scrolling ultra fast down to not see any spoilers .. is there a bug in day 9 description?
The first example above,
2333133121414131402, represents these individual blocks:but:
left: “00…111…2…333.44.5555.6666.777.8888..99”
right: “00…111…2…333.44.5555.6666.777.888899”
i just made the function by spec …
for extremely simple algo that fails see here https://github.com/jarlah/advent_of_code/blob/master/lib/2024/day_9/Part1.ex#L9
ill eat my hat if it isnt something do with the pattern matching for the parse function … i have even added more tests that prove the more simpler examples is parse correctly
sevenseacat
No. The example ends with
402so there’s 4 eights, 0 gap, and 2 nines.What does your code here https://github.com/jarlah/advent_of_code/blob/master/lib/2024/day_9/Part1.ex#L28 do if
n2is zero?Your 90909 example is also wrong - it should be
000000000111111111222222222. The description says:jarlah
ofc duh! thanks
sevenseacat
There’s been an bug in the problem on only one day that I can remember, in ten years of AOC. And there was a mad uproar about that and it was fixed within an hour.