code-shoily
Here’s my day 3 code
https://github.com/code-shoily/advent_of_code/blob/master/lib/2024/day_03.ex
This was quite easy. I was afraid Part 2 would be “un-regex-able” and was preparing for hand crafting automata but looks like it wasn’t the case. Also, nice to have that Toboggan reference. I love cross-overs.
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
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
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)
egze
Part 1:
Part 2:
mwilsoncoding
Here are my solutions for today. (if another thread for this pops up, I’ll try to delete it. My version of this thread is still pending approval
)
Part 1:
Part 2:
sevenseacat
I haven’t used regex in a while - made a few dumb mistakes before getting it right, lol.
https://github.com/sevenseacat/advent_of_code/blob/main/lib/y2024/day03.ex
Aetherus
Thanks for your regex. It’s the first time I saw
(?>pattern)in a regex.Here’s my solution:
Part 1
Part 2
Flo0807
Hey!
This is my solution for Day 03.
Part 1
Part 2
code-shoily
I just realized I could just have one function with regex as an additional parameter. (In case of first, adding true on both cases unlocks the whole list for processing)
code-shoily
I love it. Saves me a lot of “emptiness” lol.
bjorng
I went for a solution using regexes and regretted it almost immediately. It took me a while to realize that
Regex.run/3with the:globaloption will not return multiple solutions (as:re.run/3would), but that I needed to useRegex.scan/3. Fortunately, having invested a lot of time solving part 1 with a regex, it turned out it was possible to solve also part 2 with a regex.https://github.com/bjorng/advent-of-code/blob/main/2024/day03/lib/day03.ex
Having tried regexes, I decided to implement a solution in Erlang using the binary syntax to do the parsing:
https://github.com/bjorng/advent-of-code/blob/main/2024/day03/day03.escript
UPDATE: After looking at the other solutions, I realized that I only looked for
doanddon'tinstead ofdo()anddon't(). That happened to produce the correct result (at least for my input), but I’ve now updated my programs to match the parens too.code-shoily
This is the way.
mexicat
Just some average-ugly regexes.
https://github.com/mexicat/aoc-2024/blob/main/lib/aoc/day_03.ex