#advent-of-code
1 messages Ā· Page 32 of 1
Which model is that?
yeah apparently salt die has a range library
eh i dont have a subscription so whatever the normal one is
alright sure the good ones are pretty good
but this is such a stupid thing to say that i cant
MAJOR LOGIC BUG
I haven't used the free one in a long time, but the impression I've gotten from other people is that it hallucinates a lot more than the paid ones.
when did we have range splitting on another range in 2024 or 2023?
ok found it. it was 2023 day 5 part 2
I keep getting pings from here for no reason bruh
WHO PINGED ME
Are you in the U.S. and A.?
A.?
Yas.
The United States and America?
Precisely.
Canada
Greatest Country in the World, after Kazakhstan.
yeha
not the $ before variable names...
I just froze my computer and had to hard reset it because i tried a naive solution to part 1 lol
I don't think I can even get an empty python file to run that fast
||```haskell
import Data.List (intersect)
parseRange :: [Char] -> [Int]
parseRange range =
let start = read $ takeWhile (/= '-') range
end = read $ tail $ dropWhile (/= '-') range
in [start .. end]
part1 :: [Int] -> [Int] -> Int
part1 ranges ingredients = length (ingredients intersect ranges)
main :: IO ()
main = do
ls <- lines <$> readFile "day5/input.txt"
let ranges = concatMap parseRange $ takeWhile (/= "") ls
let ingredients = map read $ tail $ dropWhile (/= "") ls
print $ part1 ranges ingredients```||
so simple and elegant, but absolutly kills the pc lol, it tries to load all ranges into memory
tried to load all the ranges....
š
It worked perfectly for the example input š
haha!
in [start .. end]
šŖ¦
cash money
ironically the even more naive solution works just fine
||double for-loop O(nm)||
huh?
it does?
||https://github.com/bharadwaj-raju/aoc-2025/blob/main/day5/1.py|| finishes in just 60ms
lmaooo
it makes sense
||the number of ranges isn't really very large at all, it's just that their span is huge||
HAHAHA
was trivial as hell
For part 1
lmao
Iām sorry binary search?
is changing the input such that reading it is easier considered cheating?
No, why would it be?
its not
u can do anything
with the input lmao
Ah, ok
part 2 was even more trivial
I mean if you feel itās fine aide
sure
But you should spoiler your solution strategies in this channel
There are so many days where itās literally soo easy to just
A word like ||binary search|| is a huge clue
Find replace
like a bunch of problems in 2022
Most of the regex problems we have
There was one with some weird ass format where in thereās the info
true
I donāt quite remember what it was
Transforming data is just normal programming
But yeah
Personally Iāve never wanted to find replace since it feels against the spirit of the puzzle to ME
also I think we are entering this algorithmic type problems now I can def see some recursive solutions coming up
Thatās not to say itās wrong tho
in following days
I like AoC because you can often make it as easy or as hard for yourself as you like.
I don't think there are any canonical solutions
I saw solutions wherein people copied the input into their project manager
And it made the file system
Fair game
or 23 day 4(?)
The quadratic equation one
Wherein most peopleās solution was pen and paper
Including mine
I mean
We have the weekend coming up
Iām anticipating path finding
Or some other shit with BFS/DFS solutions
Jokes on the AoC puzzle guy, I have even less time for AoC on the weekend...
Yeah we often have those
I would love those
Last year day 10 was the first path finding one I thin
I remember cuz I tried to write a BFS/DFS solution on my one
Couldnāt
Then gave up
And on a later day wrote djikstraās
shit
Like during the AoC but later
I better get myself together and get in practice for it already I really wanna do on same day
Cuz I had to write djikstraās for another day
Day 12 or smth
just copied code
Then day 19 was also pathfidnong
I couldnāt do p2 tho
Also one of these days had smth I wrote a flood fill for
16 or smth
Have you not done any other years
yes
Welcome to the club
this also been smth
i been looking forward to each day
This full course provides a complete introduction to Graph Theory algorithms in computer science. Knowledge of how to create and design excellent algorithms is an essential skill required in becoming a great programmer.
You will learn how many important algorithms work. The algorithms are accompanied by working source code in Java to solidify y...
Learn and master the most common data structures in this full course from Google engineer William Fiset. This course teaches data structures to beginners using high quality animations to represent the data structures visually.
You will learn how to code various data structures together with simple to follow step-by-step instructions. Every data...
this is what i plan on doing
rn
after this walk
i mean we been using them
Who cares that what youāre implementing is a heap
What you care is that youāre appending shit to a list and taking list[-1]
If anything look up common algorithms ig
How so?
Or honestly the best thing is just do more years
i don't have much time
I mean theyāre even designed such that you donāt need formal dsa knowledge
I think at least in some cases there are DSA techniques that fit AoC problems well
No, not to solve them at all
As long as you can implement stuff
But sometimes you can make fast solutions with DSA
yesss
Who cares if your data structure is a heap
After all in python youāre seeing that as a list anyway
Unless you use fancy data structures
if only i had knew day 3 part 2's solution was a ||"monotonic decreasing stack"|| i wouldve probably recognized it and solved it oneshot
Yeah I donāt know what that is
But I think thatās what I wrote
See what I mean?
exactly
also itās funer like this
if you knew it beforehand you wouldve recognized it
monotonic in a sense that its either keep on increasing or decreasing
Yeah but itās not like you NEED them
Thatās what I meant
obviously not, but it's useful to know
At the same time itd be better if you just saw some common algorithms people use
Or common things that you might not know about
Like people donāt know regex
Or fun language features that can make life ridiculously easy
Think itertools
Think cache decorator
that doesn't invalidate the performance advantages of a heap
that makes it a suitable candidate for greedy approach
greedy was the first thing i did
as soon i saw it
Idk thatās not what it means in math
||did anyone else also use binary search for part 1 and therefore had to make the intervals disjoint (which makes part 2 trivial)?||
it literally does mean the same, function keeps strictly increasing or decreasing
Gary apparently
yh
i did that
No itās non decreasing I think
I might be wrong tho
literally this is what i did
making part 2 super trivial
lmaoooo
Yes
yeah
monotonic can refer to either strictly increasing or strictly decreasing
the specific direction isn't important, the point is that you stick to one
yeah
data structures are more about how you use the memory
not what it is
My point is that you donāt need data strucure knowledge to write it yourself
and that's correct
||I was too lazy to make the intervals disjoint at first but that would have made the binary search so much more tedious and now Im glad I made them disjoint||
but to say DSA is pointless is just wrong
i mean we use data structures all the times without knowing it, but would it be much better if we knew what we are using? yes
we can make better comments
dsa is the best part of cs
i love dsa
I guess I mean more like watching an 8 hour dsa video to prepare in the middle of AoC is kinda pointless lol
It takes a while to learn basics anyway
oh yeah definitely
just learn what you need for each problem, that's way more fun and way more efficient learning-wise
Yes!
I def recommend solving past year problems and stuff
You always always learn smth
there are probably more efficient ways
I did some of 2015 this year
Was a very different year
Hesh
Yeah
Idk about fun tho
You can do leetcode if you hate your soul
i don't mind going through long videos lmao also im gonna get some books on it as well
i will check local library
and online
I need to learn the best
Also Gary def learn regex
True
i hate regex
no
Itās easy to learn
Promise
Itās so easy Iāve learnt it like 2,000 times
Using DSA for AoC is useful in the sense that it helps you become more familiar with DSA techniques and make those techniques more accessible when you might need them in some other project.
Even if it's possible to solve the puzzles without them.
Last year I had the experience of like
Iām solving a problem
I do it
I go on Reddit
I see people talking about BFS vs DFS
and theyāre like DFS is better
Iām like ok guys wtf is that
They explain it properly, itbeing the great community it is
im like āoh so what I didā
Same with the flood fill
It does feel like youāre more lost if you have noooo vocabulary to talk abojt what youāre doing
And it def takes longer
But I donāt think it mattered all that much
Also, some DSA is less obvious than others. Sure, you might implement DFS intuitively, but you're probably not gonna reinvent A* by accident.
Yeah def
I'm writing a small AoC utility library, any recommendations for things to add?
I already have the "set of ranges", and 2D maps of integers/characters
2D maps?
I def recommend grid support
?
that's what I'm calling 2D maps
what functionality does it provide for 2d maps?
still thinking about that. mostly just value/range set/get
get with default on out-of-bounds is extremely useful IMO
also stuff for working with neighbors and directions
oh it does that too
directions
part 1 today seems too easy, I'm scared of what part 2's gonna be lol
Which day
day 5
today
I've solved part 1 now, part 2 doesn't seem that bad though
ok part 2 really can't be brute forced huh
just look at the ranges in the input lol
How much memory and time do you have?
like how much my solution takes?
No for the bruteforce š
memory, idk off the top of my head but my bruteforce doesn't take much, time... Rest of the day technically but that seems stupid
I think it's normally the case with AoC that even if the bruteforce solution doesn't work (in a reasonable timeframe), there is usually a relatively simple non-bruteforce solution that doesn't require any advanced algorithms to implement.
if this brute force is actually stepping through all of the ranges end of the day is a slight underestimate
What do you guys mean by brute force?
a naive solution
An algorithmically simple solution that generally involves relying on computers being fast rather than being clever.
the naive answer to "how many integers are in these ranges" of "go through all the integers and check if they are in a range" would be an example
Like, I dunno, finding primes by attempting to divide each integer with each smaller integer in turn.
Expand all ranges and count the unique numbers
At least it's not death by old age that will get you in that case
unless you have a few petabytes of spare ram
It worked on the example input š
OS killed my script after about a minute. which was actually pretty surprising it took that long
I havent had time to do any aoc since day 2. I know I won't get stars but will it still tell me if the answers are correct?
you'll still get stars
there's no time limit on puzzles
you can go back and do past year's puzzles as well and get those stars
day 5 is literally ||https://leetcode.com/problems/merge-intervals/||
oh ganksta
It's a very standard problem
yeahhhh
it's entirely possible that multiple puzzle sites will use the same general programming concept for a puzzle. š
there was also 2023/day5
I was expecting smth of that level when I first saw ranges, part 2 really let me down
yeah, was surprised. probably going to be some harder ones coming up, maybe this weekend.
why is there a bot that keeps pinging me?
obviously the new puzzles are posted at midnight. the notification spam is annoying.
You opted into the Advent of Code role, which pings you when the puzzle releases. Not everyone is in the east coast US timezone, so some people find a ping helpful.
You can remove the role in #roles
you can also ignore the bot
have to catch up, got lazy yesterday
day 4 was pretty good
i hate grids
i spent some time troubleshooting and it turns out i padded the example and not the actual input š
all my homies hate grids
I had no idea which one 2022 day 19 was - and now I've looked it up
definitely do finals instead
no good can come from doing that day first
there's your problem ||don't pad the example - find the right data structure for the grid first||
sounds like effort
way less effort than trying to deal with the problems that come afterwards
its times like these where, with every bit of my heart, i wish i could very easily do per-element addition of tuples and lists
i see why i gave up the first time
import numpy as np
definitely go back to it again - when you have plenty of free time
it's a slog - but rewarding if you eventually solve it imo
Tru
a slow recursive solution actually worked for one line on the sample inputs.....
yeah - the sample input was never the problem on that puzzle lol
I've had sample input correct answer wrong problems on every puzzle so far except day 1 IIRC.
Only today so far
And after seeing my mistake it was wild that the sample input worked
funny how that is - "sample input correct; wrong real input" has ONLY happened this year for me on day 1
Rouletters, I am undecided on a language or two to add to the roulette. This is your chance for requests!

Hey, Iāve heard good things about Python
You should be mean and do something like FORTAN or COBOL
How about one of the days as Python 2 š¤
šļø. python 2 or 1
I started late. Yesterday actually. Iām just staring problem #4.
Itās supposed to be esoteric
Not the language we use everyday at work
I can suggest using racket
Haxe?
Did u mean this as in trying to ask if thatās what I meant
Or thatās ur suggestion
Yes
Have we done octave/matlab yet?
Some array language (Uiua/J/APL) could also be interesting, but might be too hard at this point
gnu bc is another weird-ass option
(yes, you can program in it, though idk if input parsing is doable, so might need some preprocessing)
there is R which I don't think we ever did
swift we never did I think
some sql
I wouldn't mind trying Odin
Isnāt that a website?
Speaking of single letters, D would be a good one
it's been done
It has?
last year
Oh
also don't tempt Kat with fortran
(knowing Kat it will probably show up anyway)
Donāt pretend you wouldnāt love the challenge
we've had that challenge twice š
When?
twice
Man my steel trap must be falling apart
in 2 years
ye of little faith
https://github.com/algmyr/aoc-2023/blob/main/day10/main.F90
https://github.com/algmyr/aoc-2024/blob/main/day10/main.F90
I am still very tempted but I feel like at least 5 of our Rouletters will crash out with fortran this late >_>
I belive you I just couldnāt remember
Ah yes
day10/main.F90 line 1
module my_personal_aoc_hell```
the order of languages this year has been kinda weird
ruby before crystal before perl feels so backwards
perl is proto ruby, crystal is almost ruby, ruby is
is what
it just is
is that not a paid lang?
octave isn't
Flix could be interesting, tho it's mostly just a slightly cooked Haskell.
Mojo
The vaporware?
The python killler
Gotta love marketing
I'm going to make myself a service and add a list of the languages to the readmes
oh fun, 2023 was the year I started using jj
could anyone potentially give a hint for 2022 day 19 š
normal ||dfs|| takes way too long and i canāt think of any optimizations to put on top of it
I have some upper bound estimation in my code to reject things that are obviously bad
(I'm trying to remember the problem as I read my code :)
ah ok, so my upper bound thing is "what if I allowed doing all the actions at every turn"
and if the score from that isn't good enough I can just give up on this path
looking at some comments I did on the thread for that year
one pretty big optimization is that if you have enough robots of one kind, stop creating it
e.g. if you have more robots than you can even spend in one turn
This is the comments in my code.
- ||stop early if we haven't built enough geode robots to reach our goal before time limit (highest seen so far)||
- ||stop early if we haven't built enough obsidian robots to reach our goal of geode robots before we need to switch to making only geode robots (as many as we need to hit our geode goal)||
- ||didn't do the stop early's exactly, just close enough to ensure super dead branches weren't explored. some dead branches still got through but not very many (eg assume we have resources to make a geode bot each minute, assume that we'll have the full output of the obsidian miners in the whole 30 minutes at the time we start building geode bots)||
(2022/19 hints on optimizing)
I'm trying to unbreak my 2022 rust code to see how big impact some optimizations had
so the solution I have is ~10ms, without the upper bound estimate for pruning
without it is took ~2s
so ~200x speedup
I also set my thing up so that my search options skipped forward in time, no clue if that matters much for performance
i.e. my options were like
- If I wait, can I ever buy an geode bot? If so add the possibility of waiting until I can afford it and then buy it.
- If I wait, can I ever buy an obsidian bot? If so add the possibility of waiting until I can afford it and then buy it.
- ...
- Do nothing, jump to the end time.
I can imagine that cut down on the number of states I had to process, but idk how key it was to have something fast
The simple upper bound simulation helped a ton though
Like, it's very easy to write. Just simulate and ignore the fact that you can only buy one thing per turn
That way you get no branching, and you get a cheap upper bound on the best score you could reach
(good lord I had a lot of untracked stuff in my git repo at the time)
once you solve it, i remember ||https://www.youtu.be/5rb0vvJ7NCY|| being a good video on the problem
optimization isn't always about multi-threading and optimizing hardware utilization. in fact, most performance work is about simply doing less.
tantan's video: https://youtu.be/jkHqrkcEHRc
philosophies of optimization (highly recommend): https://youtu.be/pgoetgxecw8
simple code high performance: https://youtu.be/Ge3aKEmZcqY
slides & code: http...
interesting, this is using a different upper bound than I did
mine is a tighter bound, but their is faster
hm I might do the roulette afterward
the halfway point already
<@&518565788744024082> Good morning! Day 6 is ready to be attempted. View it online now at https://adventofcode.com/2025/day/6. Good luck!
why am i jumping into the garbage chute š„²
action packed decoration mission
can't even catch a break
oh hell naw š
Did anyone else's cookies expire?
holy string parsing
It depends on when you first logged into AoC after awhile this year. They should last ~4-6 weeks when they're freshly generated (which'll happen first time you visit the site after they expire/don't exist)
I longed in 2 days before Dec 1 š
i never want to deal with squid math again š
@minor cave I'm impressed you managed to hit this task with C
I didn't mind p2 too much
in python?
Yeah
:)
(oops, forgot to hit reply, @cyan sleet )
hint: ||there is a consistent maximum amount of digits, both row-wise and column-wise, 4 for me, so if you wanted to you could waste a little bit of memory to make your life easier||
I was actually thinking that they knew
I'm going to fix my input reading so I can actually run the same code for sample/input for p1 and p2
the number of lines differing between the cases is kinda cruel š
how did you know btw
I didn't, roulette language I pick is entirely vibe based plus inputs from friends who have no context
uh huh šµļø
are we doing reverse language hardness this year?
okay found it
my lsp thinks I'm writing C++
:)
:)
I should try to be not dumb and separate the bulk of the parsing from computation, huh?
my parser for p1 is 70 lines...
@hollow wharf hows it go
i did part1
im trying to write regex to parse part 2
(count everything until a space)
but its hard apparently
i could just write it in python hm
idk if i should
like ||just count empty strings after a .split()||
imma leak memory, and nobody can stop me
maybe i should and do regex later
oh never mind that doesnt even wwork anyway
alright then
got part 1 done in C
looks like i won't be pasting the code into the spoilers chat this time lol
sub 2k chars though
linux can handle it :)
part 1 is really short no
hahahaha
oh yall are not doing python?
oo i could do something really silly with a macro
yep
different language every day
today is C
#aoc-announcements message
mood
address sanitizer time
the columns are separated by a single space?
the rest of the spaces are the left-right alignment?
how does one which space separates the columns in a given input
like
is it possible that we have overlap of columns or smth
(for any further help, I'd suggest moving to #aoc-solution-hints)
or there will always be one column (in the input) of just spaces, and thats the sepator?
idk its not hints i just dont understand this problem lol
this is a fine assumption right
Part of advent of code is understanding the input, I don't want to unintentionally spoil this for someone who hasn't attempted it yet
huh i dont understand the puzzle text
oh well
lemme try fucking about a bit more and if i dont get it ill go to the channel
brain pls
bool flag = false;
for (...) {
if (cond) flag = false;
}
very new library function
I had to fight my IDE to make it stop deleting trailing spaces lol
Iām finally caught up. Just finished Day 6
ok, more general input parsing done
and p1 works still
now p2 should be a piece of cake
and done
fucking hell
so many for loops
and now i need MORE
sounds amazing
oh ffs why am i missing last col
alr minor fix
ok
holy shit fuck me
I am once again getting correct answer for the example but not the actual input š
seriously
its so annoying
im done and i think today im not gonna spend much time cleaning up code
i lowkey never wanna see this again
LOL why y'all pythoners complain about a few spaces?
first of all my code today looks
I haven't read it all. I want to express my sincere apologies for what I said.
My honest reaction.
its not horrible horrible
but its annoying
and also i didnt understand the problem text for the longest while
and thought i just need to ||find all characters until i hit a whitespace followed by a digit||
so i thought i can ||regex it||
until i realised i cant
like 30-40 minutess wasted?
hm
Most sane Python developer be like.
inb4 all the functional languages are in the later days
i hate part 2
Looking at the graphic and that weād be going down, I thought it rather likely š
augh, p2 is a nightmare. the solving is good. the parsing...
The parsing IS the problem
indeed
finally done with it
cephalopod math is weird
Advent of Code is weird
Day 7 looks kinda interesting as well
like some kind of showroom for the Monty Hall problem
Is the car behind door number 1 or 2 or is it just a goat
yes and Day 4 has the rolls of paper
which fits with the day 5 theme
Day 1 has the snowman
etc
it's how I guessed that day 6 would have us going down the chute
cool details
Day 2 has the lobby - Day 3 shows all the offline elevators
and I just realised Day 4 has the massive printer as well
and it really is a big printer - it's like the size of an elevator
might be 3 incinerators
or 2 or 1
it's 3 of something. will be interesting to see what
Probably not a room though. Too small.
Could be a hallway of elevators
clearly it's this place
silksong spoilers
Silksong sucks.
A rabbit possessed by Satan walking with a toothpick.
( I don't even know the gameplay )
Is that the plot
Of the game
š š
Def has a toothpick
yes
shes on a quest to find the person who stole her carrots
I have a few carrots in my fridge.
how interesting
Nope.
yay, I got to use my charmap type today
I have a theory that it's gonna get a lot harder tomorrow
same
part 2 had me thinking kinda more than last days
we made it through the first half
or may be i was just having a bad day
what kinds of problems are consistent over the years
which haven't showed up yet
I haven't been following too closely
the transpose thing we have to do today
peeps said its been like that every year
they is a transpose problem
I'll put it into the list of features for my library
yes def
there is also always one where you get input as a long sentence
there's also the obligatory flood fill puzzle
flood fill!
is Day 7 the filter? any bets
<@&831776746206265384>
!cleanban @earnest bridge
:incoming_envelope: :ok_hand: applied ban to @earnest bridge permanently.
I didn't mean literally šš
kalshi for aoc topics
language roulette was C, then Zig... tomorrow HAS to be rust
:)
š¤Ø
so what puzzles do y'all solve when it's not December?
CodingQuest, Everyone Codes, Tom's Data Onion, Midges n Gnats, Codyssi
wow I'l definitely check those out!
Everyone Codes is the closest to AoC
Everybody codes? Everyone Codes seems like an IT course in Vienna
<@&518565788744024082> Good morning! Day 7 is ready to be attempted. View it online now at https://adventofcode.com/2025/day/7. Good luck!
Danke Robbin!!!
Wow... I haven't even finished the day 5 -_-
who sees a teleportation pad and just steps on it like that š
good noon
it's 12 PM here
ok this looks like a more interesting problem
nice
agreed
aaaa I submitted the example input by accident
my condolences
this is interesting indeed
its that time of the day
I don't understand how I'm meant to be counting beam splits 
12PM here lol
12 am
bro's cooked
for me
i think it's ||the amount of times a ^ is hit is all||
12 hour difference eh
is it like 12 pm like rn
well
12PM i mean by noon
Nvm I was double-counting lol
which yall should also agree
we are literally 12 hrs apart then lmao
lmao
go to sleep š
day is just beginning i was talking to someone i like and now i do advent of code
šæ
is there a way to connect my program input directly to where the input is stored on the website?
God damnit I did basically P2 first
šæ
sure
there might be some extension for this
or u can create one
write an html parser
gary catch up
If i make an extension will you guys use it
my turn to oversleep
LOL
i forgot my alarm
alright imma read the problem statement now
the good thing is it doesnt look too bad
the bad thing is i have no concrete idea how to do it
||p1 is simulation, p2 is dp||
the other good thing is ill worry about it after i go brush and stuff
There are a lot of libraries for that
From the top of my head, advent-of-code-data/aocd, aoc_helper (maintained by me), aoc_lube (maintained by salt-die)
I'm sure there are more
I never did smth like this before
so this is gonna be fun and new
I understand the problem atleast now
this is surprisingly accurate lmao
i was fooled
||naive recursion approach|| did not work, and neither did ||a list of all possibilities||
had to bring in 2021 methods for this š
does the hello world in https://ziglang.org/learn/samples/ work for any of you?
i'm getting error: root source file struct 'fs.File' has no member named 'stdout'
std.debug.print("hello world", .{}); works fine though
i'm on zig 0.14.1
wow I got it done in 30 min!
whoops
the tutorial is probably for 0.15. I/O changed a lot
first
mate im writing code literally while brushinh
and getting my bed fixed and stuf
argh
multitasking pro
ill take that
||not necessarily||
ANOTHER recursion problem!
its in the name
the rest of aoc is gonna recursively be recursive
im confused about how to implement p2
might go get breakfast and worry about it afterwards
im giving myself a stack to work with
because thats usually what i do for "recursive" problems
well
the good news is my solution works
the bad news is it takes fucking forever
lemme see if i can memoize without fucking up
alright
thanks @cache
EH
why was this so easy lol
ah thanks
i hadn't updated for a while
compiles now on 0.15.2
yet another day of me forgetting about aoc
how could you
i got distracted theorem proving
math major?
math and cs
tho theorem proving is more CS related
as in automated proof checking
at least the thing i'm working on rn
i kinda don't feel like starting today's AoC before i finish work
finally solved 2024 day 21
nearly a year later
congrats, did the answer come to you in a dream or something
I just threw away most of my old code for it and tried out a new approach inspired by another AoC solution from that year
oh nice
Yeah I am not doing part 2 today, this is not the weekend I learn pathfinding
||it's not pathfinding||
Even better!
the problem says you have to ||count all possible paths||
And I do not understand a way to make that happen, so I'm going to move on
everytime the solution im thinking of involves ||recursion||... i tend to almost give up
last year I was going crazy ||trying to predict which move now would result in the best move 25 layers later by heuristics, by doing simulations up to some constant further layers, constructing each layer's move sequence based on that, and other nonsense||
instead I noticed that ||you can just write down the best move for each (from, to) pair for the dpad, and use that to just construct the best move for the next layer. this alone was an efficiency improvement, but still wasn't enough though since you'd run out of time and memory trying to construct the best move 25 layers out, so I used the same strategy I used for day 11, which is that we just need the length and not the sequence 25 layers out, and we can aggressively split on As to basically cache everything||
honestly, not the worst day today, I just had a brainfart and thought the naiive way of doing part2 was actually the clever way
the secret is ||dynamic programming||
that, or there is still an entirely iterative solution
||dynamic programming|| can be iterative 
oh right, i thought ||you were just talking about making a recursive function that also uses a cache, that's just what my mind defaults to thinking dynamic programming always is :P||
Yeah I don't know these terms
š
I'm ok with not solving a day, I know I have a basic understanding of programming in general
as a hint, you want to count the number of ways to arrive at any particular point
and counting doesn't actually require iterating over all paths
I think considering this basic case should be enough to give the overall idea
..S..
.....
..^..
.....
.^.^.
.....
annotated with counts
||```
..S.. 00100
..... 00100
..^.. 01010
..... 01010
.^.^. 10201
..... 10201
Roulette language TeX when
beams cant be next to each other right?
why not
huh
interesting
very interesting
was going to quickly do it today jumping off of last year's roulette code, but seems like zig has moved on and it's kinda late
and makes me feel dumb for not thinking of that
HMMM
so its like literally just ||2^n|| is it?
well it cant be
hm
oh i did think of that and went 'cant be'
but clearly there should be a combinatorics solution
when counting the tachyon splits, can I just count 'splitters hit by a beam'?
yep
spoiler that
also sorry i thought you were talking about p2
wouldn't that only work if the splitters were distributed in a regular geometric pattern?
I do think it's time to finally create an IntMap...
https://paste.pythondiscord.com/M7FA
oh wow, the easiest way to solve today's puzzle is probably to do what exactly the question specifies
It's mostly the reader/writer generics that happened
me when it takes 30 minutes to figure out reading files
!cleanban @vagrant bear scam
:incoming_envelope: :ok_hand: applied ban to @vagrant bear permanently.
Am I the only one who's struggling with today's part 2?
not at all, I've seen many other people who had trouble
you can ask for help in #aoc-solution-hints
My solution is too slow because I'm looping over all timelines to check if it is a "^" , I'm debating shouldn't I just another language
Which language are you using?
python ._.
Language change wonāt help
it's not (necessarily) a language problem, my Python solution finishes in ~65ms
depending on how exactly you're doing this, the change might just be ||functools.cache||
I'm not saying it's a language problem I'm saying I'm lazy to change the algorithms š¤£
the problem is that an algorithm too slow to solve this is going to be too slow in any language
just by the scale of the computation
Youāll have to - but as said above it might or might not be a big change
I will say this - this kind of problem and the solution most go for is one of Advent of Codeās staple type of problems
You get one problem like this each year
FWIW I had to rewrite my Part 1 to Part 2
it's my first yr
Not a huge rewrite but still
that said, sometimes you can get away with a stupid algorithm just because of a 100x speedup from picking a different language
Like switching from Bash to Rust
well... that might be 1000x
I would defend bash... but you might be right.
exactly š¤£
speaking of, did anyone solve day 4b using the most naive approach? (just doing exactly what the example walkthrough did, ||removing a bunch of paper on each iteration until you can't remove anything||)
if it's a combinatorial explosion like I assume is happening here, though, I doubt even Rust would save it
quite a lot of people did
Guilty as charged
that was what I did at first yeah
it was fast enough
I switched to a slightly more interesting approach later just for fun
how long does it take in python approximately?
I dont understand why the sample beam only splits 21 times
If I count the number of splitters ( ^ ) in the sample, I get 22 and not 21
What am I missing?
Because beams donāt fall on every splitter
not all splitters are hit by beams
one of the splitters goes unused so to speak
I did ._.
Which one? Its so confusing looking at all the |'s all clumped up
Yeah It wasn't a big change and it wasn't functools.cache
Ah nice
Is it the middle splitter in the 3rd splitter row from top?
5th splitter at the bottom Iād say
Just had to change list to a dict
Ohhhh
gotcha
thanks I missed that
iirc, 300 ms using some numpy
mine was 2ms, so maybe my factors aren't too far off
same naive solution
(maybe you had a harder input though)
did you || handle the edges of the board separately to reduce branching ||?
My solution takes 2 ms
it's a smart one though?
nah. it's braindead simple
do you have a link? I'm curious
I just used a dictionary to keep track of how many lasers are in a column
oh, we're talking about day 4 part 2
nvm sorry
I haven't touched day 7 yet, I'll probably come back to the second half of AoC next year
my day 4 was 280 ms using the simplest approach I was lazy to make it faster
using a different language also can mean different memory footprint, for example you can better make use of memory-speed tradeoffs i you can get very small integers
though Python does have array.array and numpy
Using numpy made it slower I was amazed ._.
perhaps counterintuitively, getting an integer out of an array.array is slower than from a list. Because you have to construct a whole new int object based on the raw numebr
maybe it's the same thing with numpy, where you chat with it a lot instead of doing vectorized operations
My p2 Python solution takes 0.8 ms.
yeah I updated mine and it takes 2 ms
But yeah, you never have to switch language for AoC
a castle, a flag, a ladder (?)
Hm, is it like a stable or something on the side there?
||cache||
i think thats what we all did
also isnt that day 5
nope its day 4
i just mistitled my post
Spoilertags
indeed
lmao
I've been behind, I had other things to do and I was out so I only just completed day 4
tomorrow will be the floodfill problem
I feel it in my bones
Are we the only one who solved day 2 with regex? Lmao
I maintain that just generating invalid IDs is a lot easier than checking whether a given number is an invalid ID
it was faster certainly, but idk about easier
Generating all possible invalid IDs then checking against the ones in your input?
not quite all. more like all within a range
You do full scans on each iteration? If so I wrote a fun test case generator that makes your code take O(nā“) time (assuming the board is n*n)
caught up on aoc 2025, maybe I'll actually do it this year
spent an embarassing amount of time on d1p2
Many many people did that myself included
so when do we think path finding day is coming up?
I blame spreadsheets on a phone
the ux of that is horrible
For me itās definitely trying to over-optimise because I was so embarrassed to have to do it the very naive way
ah, that wasn't even an option when doing it on a spreadsheet
or at least idk how one would do the naive way
maybe it's possible with arrayformula 
For part 2 it would be ||breaking down each L or R instruction into 1 step ticks and checking the position at every tick ||
For Python anyway
right
Not sure about spreadsheets :)
I just don't know how one would even express that in a spreadsheet
Fair enough - I have no clue either
Fingers crossed
Keeping with tradition i think the hard day should be day 18 or maybe 22
<@&831776746206265384> (its a scam)
!compban 1447363591668764672
Could not convert "user" into UnambiguousMember or UnambiguousUser.
User "1447363591668764672" not found.

!compban 1356942068177702922
:incoming_envelope: :ok_hand: applied ban to @tribal frigate until <t:1765494463:f> (4 days).
iirc you can make cells refer to themselves and do recursion that way. mutual recursion even
Only 12 days ._.
š
Itās only 12 days
this time
people missing my joke makes me sad
Wait u meant as in overflow
Didn u
no i meant i hope they dont have hard days
I was way too off
š
Ts cooked
I'm fine without puzzles that need z3 or hard parsing hundreds of lines of assembly. But I wouldn't mind a graph traversial or A* or whatnot.
this is from aoc 2015 - how can i count ALL targets in line - on line 20?
line.count()?
Need to sleep so a helper needs to open spoiler thread. Good luck y'all
fun language šļø
pypy is not the answer šØ
5 minutes to go! Why am I nervous? lol
lets seee
i hope not
or maybe i hope so
cuz i can handle that
I've been doing fine until Day 7 and then the multi timeline thing just confused the heck out of me. I still don't understand how to count a "timeline".
im expecting another another 'naive approach takes 4 petabytes of space'
1 timeline is one unique path the tachyon can take
It's funny how one little problem can destroy your confidence.
you have to count all paths to all possible end points
yeah dw youlll get there
Think of it like a pinball machine where the pinball doesn't bounce back up
im surprised i could make it this far
like
one of those gaussian distribution thingys
i forgot hte name
Yes, but I don't understand how to count individual timelines. I either count way too low or way too high. It's not even about developing an algorithm yet, it's about understanding the requirements.
Ah yeah that had me stumped for a bit
the ||recursive|| solution is kind of intuitive but I challenged myself to do it without ||recursion||
Took a couple hours but I got it
That probably should've been spoilered a lil bit
are ya excited
Like I originally thought it was just 2^#numberOfSplitters. But that's way too high. And I finally understand, that when you choose a path above, that means some splitters below don't see that particular path, so it can't be 2^#numberOfSpillters
2^splitters means the beam has the possibility to split at each splitter
<@&518565788744024082> Good morning! Day 8 is ready to be attempted. View it online now at https://adventofcode.com/2025/day/8. Good luck!
Right, and I finally understand why that's not the case.
In each timeline, only one splitter at each level can be reached
oh fucking shit
Yes but more importantly: ||whether you can hit a splitter is determined by other splitters further up||
fr š
time for ||itertools.combinations|| again...
i hope thats good enugh fro part 1
i almost fell for it
oh wow, ||mst||
ffs
even the naive approach requires work
this might be the day i clock out
alright
good problem
im gonna take a whie
Worst part is if my helper had worked I wouldn't have needed to write the buggy code lmao
||disjoint š set š union||
Slund like a protest