igorb
Advent of Code 2024 - Day 15
I found today a bit tedious: advent-of-code-2024/lib/advent_of_code2024/day15.ex at main · ibarakaiev/advent-of-code-2024 · GitHub.
Most Liked
igorb
Oh I’d hate to accidentally delete my code for this one… I usually use reduce_while/3 if I need to return early. Tons of it in this problem.
lud
I thought it was going to be tedious at first but in the end, just a couple modifications from part one are enough. This runs in 15ms:
https://github.com/lud/adventofcode/blob/main/lib/solutions/2024/day15.ex
Aetherus
For example, in the following case
######
#...##
#[][]#
#.[].#
#.@..#
######
^
In this case, I try to push the box on the 4th row upward, which in requires pushing the left box on the 3rd row upward (ok), then the right box on the 3rd row upward (failed). In traditional programming language, you need to pull back the left box (backtracking), but in Elixir, you just need to use the state before pushing.
Popular in Challenges
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








