rugyoga
Trending in Challenges
Other Trending Topics
A little off-topic, but I feel like people here have a good head on their shoulders.
I used to be quite good at making software. Was luc...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with.
But I don’t use it anymore.
Serverless was the promis...
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
- #ai
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #security
- #performance











Showing Posts 32 to 23- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
stevensonmt
What is this pattern matching wizardry:
Also your explanation of the linear algebra concepts is fantastic. Thanks for sharing!
stevensonmt
Thought about rewriting part 1 to use Cramer’s rule like part 2 does but I quite like my comprehension use, actually, even if it’s not terribly efficient (part 2 finishes faster than part 1 lol). And no, I didn’t know Cramer’s rule. Reddit to the rescue again. I like it when I learn something new. Or something I may have known 30 years ago and forgot all about since linear algebra is not exactly prominent in my day to day life.
I also finally decided to structure this day with the test data as an actual test that is run with
mix test. Rather than running it as a script I’m compiling it and running fromiexwithiex -S mixand then calling theDay13.runfunction from there.ken-kost
Man that’s elegant. I tried similar but with float operations and conditions and such… complications and of course it didn’t work out for part 2; although I got correct results for part 1 input data.
Anyway, I’ll try to sear this into my memory:
lkuty
cblavier
Here is my solution for Parts 1 & 2 using the equation-solving approach.
)
I didn’t enjoy this challenge very much, I prefer more algorithmic ones (and I struggled a bit at simplifying my equation
My code (more parsing than solving)
mwilsoncoding
I feel like I just took a college class. It’s been years since I visited linear algebra, but I’m gonna get a book on it cuz this was fun.
3-blue,1-brown’s series on linear algebra explains things in a visual way that makes a lot of sense. Not sure I understood it back in college as well as I had to for solving this problem. Didn’t help that we were forced to do pen/paper solutions. Kept me from seeing “the joy of linear algebra,” so to speak.
I noted down my thoughts as I wrestled with the concepts. If anyone would like to correct or add to my understanding, I’m all ears.
jarlah
I solved part2 today with the use of linear algebra. But it was a blatant copy paste. I think this and maybe the previous day (12) marks the end of where i can use dynamic programming alone to solve the puzzles. Its a bit sad i had to resort to math, but hey advent of code cant just be Enum.reduce
i solved myself some cognitive overhead by actually naming the variables to match what the function actually takes in .. still doesnt “make sense”, but its easier to following the x’s and y’s i guess ..
haha just found the spoiler functionality
would be REALLY nice actually to avoid scrolling past posts to not get the answer thrown into your face
haha ..
def solve_machine({{aX, aY}, {bX, bY}, {tX, tY}}) do
x = (bY * tX - bX * tY) / (aX * bY - bX * aY)
y = (aX * tY - aY * tX) / (aX * bY - bX * aY)
end
billylanchantin
Ah I see @hauleth beat me to this observation! An incident at work kept me from this puzzle until today.
billylanchantin
Linear algebra tells us there is at most one solution to this system of equations (that it’s integer division doesn’t play into it). We can solve with a simple application of Cramer’s rule or any equivalent method.
LOC: 13
jarlah
dam! THANKS! It was just “off by one” issue .. removing greater than and using ===
now i probably will need to go off into the linear algebra territory also …I just hate it when i cant use normal dynamic programming for part1