#advent-of-code
1 messages Β· Page 31 of 1
but i anyway mainly skim through the descriptions, and use the example input and output to deduce what needs to be done
I thought it was quite clear.
huh how does this happen
maybe it is my pyenv shim.... let me test without it
yeah... now it is the same
really enjoyed solving today's problem
I feel like today was the easiest one so far
Oh no part 2. Since I don't know DSA this is going to be fun....
I looked at my colleagues code and learned some new syntax (being able to define variables and use them in a function using let/in) I wouldve done part 1 very differently otherwise
RIght now I did part1 recursivly
ok hold up a second
today's problem is fixing escalators?
can we not simply walk down the stopped escalators?
"But, don't worry! It's not fried; it just needs power. Maybe you can get it running while I keep working on the elevators."
what kind of lazy ass xmas helper are we
I was also thinking that it's a fire hazard if elevators are the only way to get to the lower floors
christmas hopes and dreams are at stake and we're stuck doing maintenance work instead of just walking down some steps
can somebody help me with day1 part 2 im really struggling
It's the server channel for the https://adventofcode.com/ programming puzzle advent calendar.
AoC is not associated with this server, but we open a set of channels for it every year, as a server event.
And we have a server leaderboard and such.
#aoc-faq for details
i like the first 3 days of this year so far 
is it too late to start?
Nope
In fact, you can do this year as well as all previous years whenever you want
We only have a leaderboard for this year integrated with the server though
But the puzzles themselves are doable forever
where i can find it?
If you take a look at #aoc-faq, that should answer most of your questions.
ok
I'm more of a where guy tbh
Hey the day 3 is much easier than the day 2 :D
That seems less efficient if the let is only used for 1 path
I thought so too
I mean I finished it in just one sitting
As in you want to scope it tighter using let-in?
For example here it wasn't used in number == 0
||```diff
| number == 0 = (read :: String -> Int) batteries
- | otherwise = findJoltage2 (batteries ++ [nextDigit]) (number - 1) (drop 1 (dropWhile (/= nextDigit) bank))
- where
- nextDigit = maximum (take (length bank - number + 1) bank)
- | otherwise =
-
let nextDigit = maximum (take (length bank - number + 1) bank) -
in findJoltage2 (batteries ++ [nextDigit]) (number - 1) (drop 1 (dropWhile (/= nextDigit) bank))```||
lol doing regex for day2 is apparently ridiculously easy
i was scared of doing it cuz
i dont have enough regex practice really
but i could write it up in just a few minutes and well
yeah!
ok its not exactly DONE DONE yet but its ridiculously easy
just a few lines of code total
If im a starter in python its good for me to do advent-of-code?
yes!
i mean
do you mean in python or in coding
even if its coding, yes!
i started from 2022 and im sure i wrote some really shit code
but this is how you learn lol
and nothing is more fun than aoc for coding practice
tbh aoc is the only time i really do any intensive coding at all
I'm still stuck on day one LOL I think I might be too new to do these LOL
if you have the logic part sorted out, then looking up syntax ain't that hard
Both
Yeah I don't think I'm going to do part 2 on my own
today's?
Correct
Hint: ||just repeatedly pick the largest number that doesn't leave you with too few remaining to hit the 12 count||
Good job
||is day 3 a regex thing too?||
i would do it right now but im going to a careers event thing which is obviously more important
You should try it yourself first.
How easy are these little puzzles and waht type of puzzles are they?
So far they are all very doable, but they tend to get harder later in the month
Its easy for a beginner?
Δ°m not a coder Δ° just know print
Thanks
yes
well
d3 is honestly easier than days 1 and 2
at least for me
day 2 is kinda hell if you dont wanna ||regex|| it
day 1 is a thinker
I just bruteforced day 1 π
what is advent of code
how did you guys find day 3? now about to start
Some say it's easier than the previous days
i found day 2 quite simple to be honest so maybe thats a good sign
day 1 was HELL
and i mean hell on earth
Yeah day 3 is only hell on Mars /j
dont say that viv ;-;
(I have no clue haven't done any of them)
where i am apparently (in hell because i haven't solved part 2, on mars because my part 1 solution was apparently not what most people did lol)
although i think i have a solution after a few hints
i actually dont know what approach to take
im wondering how hard || regex || would be
Day 3 part 2 is so nice
advent of code baiting us with easy puzzles to drop some category theory stuff on day 11
π π π π π π
santa needs help with his monad
how do i do spoilers
Lmfao
i mean that is the second to last day this year, probably will be hard
|| spoiler ||
||
backtick backtick backtickpy
code
backtick backtick backtick
||
||you have to admit though that the double reccursion is nice||
||Santa is actually Satan||
when i print lines from a file is there a way to remove the whitespace between each one lol
its just annoying
What you mean ?
White lines between them
like when i do for line in file i get
line 1
line 2
...
just looks annoying
i want it to be like
line1
line2
...
Ah cooked what I do is lines = file.read then I do lines.splitline()
end=""?
This is what I use vast majority of the time to read the input file:
with open(r"day#/input.txt", "r") as f:
data = f.read().splitlines()
Same
What I use as well
I just copy and paste lmao
π π π π π π π
to be clear, I am copy-pasting the input from AoC into a local text file. This is what my actual solving file uses to read that input file.
Yeah
what is that, looks regexy
regex-y
Lmao
just the r""
It's not, I just added in the # placeholder since I have a different folder for each day. the r is just to read it as a regex/raw string. So a \ would be an actual \ and I don't need to \\
Thatβs just to get the file day file
oh ive never used raw strings
But thatβs not the part you might need
To solve ur problem
i know im just doing this for debugging purposes
I recommend it for file paths and regex patterns. Way eaiser to add the r in front of the string instead of worrying about escaping everything you need to escape
Yeah I just copy paste into my solution, and remove it when i commit (usually, forgot to day 1, it's a private repo anyway though)
ah got you
also can we take a moment to appreciate the fact im on day 3
im impressed
No strip?
I don't think AoC adds whitespace on either ends of their individual lines
Reminds me
I gotta commit all my files
To GitHub as well
They add trailing whitespace, or maybe im bad at ctrl+a ctrl+v
It doesnβt for me
I do the same
well yeah, you gotta do ctrl+a ctrl+c ctrl+v /j
but yeah no whitespace issues here
yeah, looking at my input no trailing whitespace
Finally completed day 3
π
Why sad
Yet another thing that complicates my day
so you for sure are getting trailing whitespace in the raw input? what browser do you use?
Im too cozy on the couch to get up and double check
I literally do ctrl c then p in vim
Understandable
wow the AoC dev really likes the idea of 'treating numbers as sequences of digits' this year
I don't think that's a this year thing
I don't remember it that much in previous years
we've had a rate of over 66%
Usually the AOC dev really likes 2D grids
we're yet to see one but they are definitely coming
I can't wait for the first 3D puzzle :)
π π π π π
There is 3d ?!
Dang
can never visualise them in my mind's eye, ever
π π π π π π π
Hopefully not such this year
This year feels so relaxed compared to the usual, since there's no global leaderboard
which is nice
Even though I know someone somewhere solved every problem in 45 seconds.
An Xmas themed puzzle series should feel relaxed IMO
But now I can't see indisputable proof.
π π π π π π π
True
Very true
Xmas is about fun and comfy
There were years back when I was younger when I'd get up at like 5 in the morning to try to get a good time
And it honestly was just frustrating
I never ever did that
I only ever logged in in the morning when I was already awake
time zones
but never actually woke up to do 5am
Itβs every day at 12 am
For me and I usually up
Last night fell asleep π β οΈ
Did it in morning
but it was chill
Maybe it was 6am. It's 6am this year anyway.
my timezone has until now been very convenient
i forgot abt aoc bruh imma wanna do 3 days ontop of homework π
day 3 might be the first one i don't get all stars within the day tbh, part 2 is so hard
What are you stick on
dudeeeee
what are you stuck on
i had issues coming up with the part2 solution, got help from the gf
she did the examples on paper and that helped
Today was easy
EST users at 12AM
I do it at 6-7 PM though
no reason to wake up so early
my part 2 works on the test data but not on the real dataπ
many such cases
sounds like for the most part, people are split over whether they accidentally already fixed part 2's gotcha during part 1 or not
part1 is always a brute force for me
i mean usually i'm the same, but today's "optimisation" kinda felt so free that i couldn't not do it
Every day optimisation is free.
I had no idea there was even a gotcha
Yeah now looking at the Reddit I see what the gotcha was meant to be but didnβt even consider it
is this a typo? 99 and 10 are not repeated in those ids
9 and 9 is
then 1010
two times 10
so they are repeating hence invalid
yes, but it's not in the string given. 95-115 has only one 9
It's the same way why 11 is an invalid ID. It's the digit 1 repeated twice
It's a range, not a string
yeah
oh
The ranges are separated by commas (,); each range gives its first ID and last ID separated by a dash (-).
95-115 is, 95, 96, ..., 115
Hello
hullo
Howdy
hello
15 mins left to
midnight
i agree with this
reminds me of 2021 day 22
6 mins to go
dude what if its smth like graph problem or smth lmao
already
aoc time, yippee
I haven't done an AoC Dijkstra yet this year
<@&518565788744024082> Good morning! Day 4 is ready to be attempted. View it online now at https://adventofcode.com/2025/day/4. Good luck!
ITS UP
No way
its 2d
Wait?
lmfao
How can I get removed from the ping
you got the advent of code role
ok lol
remove it
I haven't been active on this server since I joined
lets try to be somewhat fast
I dont how I got added
thought ill copy old code for this
and nah
suffering omg
ok ill take my time with this one
i dont rememberr how this re feature works
arggg lost 2 minutes to bugs
Ugh. Part 1 was rough. I forgot how my tools work.
did someone ping me here?
I didn't have any bugs but I lost like 15 seconds total to my right arrow key not working :')
@quaint haven Pingggg!
The l key? Or w?
first was ||dict.get(x, y)|| and second was ||creating sth then not using it so p2 never actually went through|| lol
u have to be kidding meππ
Lmao oops
No, literally the right arrow key. I've been having problems with it and it decided to not work while I was being indecisive about my code lol
it's been every day now lmao i should really test on the inputs
||dict||? Do you mean ||sets||?
My p2 reused my p1
Do you use a helper library? aoc_helper can scrape the tests for you, if you're using that
(*usually)
My helper scrapes all the <pre> blocks. Does that identify which blocks are the tests?
no, one bug per part ||but could've used a set yeag||
There's a horrible heuristic it uses to decide which <pre> is the test and which <code> is the answer lmao
ah no i've been rewriting my library every year now but this year i haven't automated anything yet
Fair enough lol
I'm interested. My helper grabs too much and cleaning it up is a hassle.
i am so pissed they let the ||naive work||
reusing my template from https://everybody.codes/event/2025/quests with an ungodly amount of imports and yet it's still never enough
that was a fun 2d puzzle
I've just realised this is POSTing, which is probably not correct
But hey, it works
Less serious of a bug than when GETting your private leaderboard's delete URL would delete it, I guess
Yeah. My Everybody Code reuses a ton of AoC stuff.
So, I skimmed the intro. I saw "rolls of paper" and thought we were working with rolls of toilet paper. I even used t for toilet paper in a var.
Lmao
day4 chat where
oo roulette true
this one is okay
I pinged kat like 10 minutes ago lol
/aoc join ?
''.join()?
lol
Ah yeah that makes more sense lol
||brute force|| for the win :D
Yeah
I mean ||the grid's only 139x139 so you only need like 70 iterations at worst||

that's the part 3: ||take the original grid and repeat it 255 extra times down and across||
Lmao yeah if this was day 15 in a previous year
there was something like that in 2021 i remember
is day 4 the equivalent of old day 8? 
Theoretically
I think this was somewhat easier than a d8 puzzle
Was it actually d15 LMAO I just pulled that number out of nowhere
yep that was the one
Guess I'm just traumatised /j
π
Tbh that one doesn't actually look too bad
as long as eric doesnt do a d19 again.......
what was d19
getting started
- hello world
ok ok the usual- http server
what
beacon scanners
forgor what was the intended sol
Oh god yeah beacons was awful lol
also ||brute force||
Honestly no idea, I'm pretty sure I just shoved into z3
well, intended as in "i intended for it to work when i tried it, and it did"
2023 i believe
No spoilers thread today?
2023 19 is apparently something about workflows
yeah i think its gonna be quite easy too
but im not gonna code it fast
yeah today's was pretty straightforward.
wtf sigh
lmfao
it might be too early to say (1/3 of the way through?) but ngl im not liking this year's set of challenges compared to previous year's
!e
[2,3]-[2]
:x: Your 3.14 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File [35m"/home/main.py"[0m, line [35m1[0m, in [35m<module>[0m
003 | [31m[2,3][0m[1;31m-[0m[31m[2][0m
004 | [31m~~~~~[0m[1;31m^[0m[31m~~~[0m
005 | [1;35mTypeError[0m: [35munsupported operand type(s) for -: 'list' and 'list'[0m
||use a set.||
i took same code as of part 1 added in a while loop and that was it
!e
[1,3]+[2]
lmfao
:warning: Your 3.14 eval job has completed with return code 0.
[No output]
yeah indeed
did u solve it
||use a set:
aocdata -= x
```||
is there a day 4 forum post?
not yet
same
kat caught lackin
kat went to bed early, i'm looking for a mod real quick
usually its already up as soon problems are up
alr
<@&831776746206265384> anyone mind opening a spoiler channel?
conga-rats!
istg gary if youre above me in leaderboard now
ngl this might have been warm up for us to prepare for whats coming
a few minutes of difference
38
did it update alr
ig its cuz its the middle of the week
i shit you not
i couldnt quite figure out the condition for a while loop
so
.
i put on True
that should handle it
yeah while True is kinda messy tho
bruh
just in
case
so i kinda automatically avoid while true lol
but yeah ok that works
yeah
imagine theres some stupid edge case in the input
and im fucking waiting for it to finishh runninng
but its just stuck in a while True π
altho thats wayyyy too many iterations for an upper bound
(ok it was a bit lesser i bumped it up for meme pointss)
lets write clean code for the spoiler channel
dude
nah too much work
how is this easier than any of days 1,2,3
this don't need any cleaner code
it works
its 12:43 am for me now and tmr morning i need to shovel snow
its snowing
;-;
What do you mean?
canada vibes
we dont have one
for day 4
at least we dont appear to have one
Kat went to bed, #1047673173447020564
I haven't even looked at the problem, so I can't look there
thanks!
π
reminds me of the
thats a set no shit
fish: Fish = Fish()```
tbh its fine since its just 'i type hint everything'
did u type hint while
AOC as well
lmao
or u do it later
not till today
since i dont quite know what data structure i want
and its easier to change a [] to a ()
than to chage list to tuple
im considering reading some DSA to get equipped for coming days
i see
are you in college as well
or you started working
oh
im in a gap year
a set of what
oh i see
better
now i can justify the type hint too
you could also do removed_position = set[complex]()
what?
is this a valid
syntax
thats a thing?
yes
i'm gonna hold your hand when i say this
why not use type hints instead
it is technically a type hint
or best:
set[complex]() already tells your typechecker that the type is set[complex]
so no need
hmm
i eae
which would you prefer
since i have type hints on every single variable
feels cleaner to just type hint like this
real peeps let the type checker figure its shit out
use whatever you think looks cleaner
personally both are fine
but, objectively, removed_positions: set[complex] = set() is more redundant
it's saying "removed_positions is a set of complex numbers which is an empty set"
compared to the set[complex]() that says "removed_positions is an empty set of complex numbers"
Oooh. Generics. I should start using those.
well i mean
hm
im just initialising it rn
We've now entered the grid puzzle portion of AoC
Auto parse ftw
gotta meme. it's tradition.
if it works it works
again, an example of santa and his elves' incompetence
why do they even have rolls of paper lying around??
someone call OSHA
"We're pretty sure there's a cafeteria on the other side of the back wall. If we could break through the wall, you'd be able to keep moving. It's too bad all of our forklifts are so busy moving those big rolls of paper around."
you are using forklifts to break through cafeteria walls??
I doubt the forklift operators are certified
i bet tomorrow involves fixing up the broken wall
does the cafeteria not have a door
Not to the printing room, presumably
wow today was easy
So far I feel like all of the puzzles have been amenable to solving in dumb obvious ways.
Like, you can do all of them in optimized somewhat clever ways, but you don't have to.
Which has not always been the case historically.
Yesterday p2 was impossible the dumb way
Of course, the optimization was not hard, but still
Well, I guess there's "dumb" and "dumb"
My intuitive solution worked and it didn't feel very clever
||Doing max on a moving slice window||
But today was... yeah
It felt like a 25-day day 4, not the day ~8 it should've been if the compression of the difficulty curve was linear
I wonder if the ramp in the later days is just going to be incredibly steep, then
The difficulty curve is not typically linear though
Yes, but the compression of it into 12 days might have been, though evidently it is not.
I remember when I'm writing game of life on the day 4 part 1 ._.
This one is kinda like that
Todays was easier than the previous ones imo, I liked todays cos it was a grid
I think its still cos we are pretty early in the days. Maybe day 6 (12 normally) it starts ramping up and needs the optimizations
Ah, right
?
<@&831776746206265384> irrelevant crypto stuff
!ban 1351973109065973813 crypto scam
:ok_hand: applied ban to @slate hemlock permanently.
oh i never checked lol
for a range based for loop there's each with a range
and for foreach there's each on the collection
so i didn't reach for it
why do we need batteries for an escalator anyways
Do these times start the moment the puzzle gets released
because I did not spend five hours on day 4
yes
yeah, unfortunately the time zone convenience is kind of just luck of the draw :p
ESTπ
I do it at like 6 PM though
If you start questioning that then all of Advent of Code falls apart
Wild coincidence, but my Part 1 logic ended up being almost exactly what Part 2 needed. That never happens to me π
https://github.com/cak/advent-of-code-2025/blob/main/2025/day04/solve.py
Also, I hate grids.
Ruby and Crystal are such nice syntaxes to work with after Clojure. I've never touched anything that looks like lisp. I was not enjoying getting errors every 2 lines of code I wrote π
Yeah part 2 is exactly the part 1 with a loop
π
I love grids. I hate cuboids
I had to Google cuboids, so we can be sure how well Iβll do on those! π
Grids are ok until you need to do anything with neighbors
what is your opinion on 6 grids that fold into a cube
That is my exception to my rule of hating cuboids
The one and only exception that proves the rule
yeah part 2 was just looping over part 1 with minimal changes
only annoying part was the case work
Neighbours are fine if you know how to preprocess the grid in the first place
i love grids
I could have just ||added empty rows above and below the matrix and also extra empty columns (empty/not filled with '@')||
it is well worth creating a helper function to give you various kinds of neighbors of a position on a grid, then it isn't nearly so annoying
yeah all of these ||```
for(int j=1; j<n-1; j++) {
int i=0;
if(mat[i][j]=='@') {
int cnt = (mat[i][j-1]=='@')+(mat[i][j+1]=='@')+(mat[i+1][j-1]=='@')+(mat[i+1][j]=='@')+(mat[i+1][j+1]=='@');
if(cnt<4) {
sol++;
mat[i][j] = 'r';
}
}
i=m-1;
if(mat[i][j]=='@') {
int cnt = (mat[i-1][j-1]=='@')+(mat[i-1][j]=='@')+(mat[i-1][j+1]=='@')+(mat[i][j-1]=='@')+(mat[i][j+1]=='@');
if(cnt<4) {
sol++;
mat[i][j] = 'r';
}
}
}
for(int i=1; i<m-1; i++) {
int j=0;
if(mat[i][j]=='@') {
int cnt = (mat[i-1][j]=='@')+(mat[i-1][j+1]=='@')+(mat[i][j+1]=='@')+(mat[i+1][j]=='@')+(mat[i+1][j+1]=='@');
if(cnt<4) {
sol++;
mat[i][j] = 'r';
}
}
j=n-1;
if(mat[i][j]=='@') {
int cnt = (mat[i-1][j-1]=='@')+(mat[i-1][j]=='@')+(mat[i][j-1]=='@')+(mat[i+1][j-1]=='@')+(mat[i+1][j]=='@');
if(cnt<4) {
sol++;
mat[i][j] = 'r';
}
}
}
I just wish all the stackoverflow answers and stuff for getting neighbors weren't so ugly and golfy
and whatever this is
They're all littered with 1 letter variables and excessively long list comprehensions
for the two main ways i represent grids (set[complex] and dict[complex, T]), i usually have
deltas = (-1, 1j, 1, -1j)
corner_deltas = (-1 + 1j, 1 + 1j, 1 - 1j, -1 - 1j)
all_deltas = (-1, -1 + 1j, 1j, 1 + 1j, 1, 1 - 1j, -1j, -1 - 1j)
defined, so i can just import them and loop over them
this AoC my repo is extra broken so imports don't even work correctly, so i just copy and paste the code
you can just loop over product([+1, -1, 0]) and append to a list, if you're not a fan of listcomps (just exclude (0, 0))
or, just manually write out all the deltas
nvm
I'm fine with listcomps, I just don't like 100 character ones lol
If I have to deal with neighbours in AOC grids I almost always ||convert to a container of coordinates first - usually a dictionary but maybe a list or set||
ALL_DIRECTIONS = [vec2(x, y) for x, y in product([+1, -1, 0], repeat=2) if (x, y) != (0, 0)]
CARDINAL_DIRECTIONS = (vec2(+1, 0), vec2(-1, 0), vec2(0, -1), vec2(0, +1))
from my utils
then it's as simple as
class vec2(NamedTuple):
...
def all_neighbors(self) -> list["vec2"]:
return [self + delta for delta in ALL_DIRECTIONS]
def cardinal_neighbors(self) -> list["vec2"]:
return [self + delta for delta in CARDINAL_DIRECTIONS]
It looks nice, but then you gotta construct that neighbour list all the time...
Hm, I'll see if I can do that for ||day 4 and not lose performance||
Oh, it's actually faster.
Go to #roles and you should be able to remove it there
Ty fam
Also going to expand spoiler thread permissions to helpers.
_> I fell asleep early and then proceeded to sleep for 11 hours
did you wake up well rested or tired?
Not sure yet
since it happens at a known time, can't we put one of the bots up to the task?
I wonder if we'll havr another day where p2 is another "find the Christmas tree" type of question
scary line of code
That's the plan especially without a global leaderboard. Just haven't had the time to implement it
that one was kind of annoying ngl
I liked it because I did an unintended solution
@jovial imp It's better to just post your solution un-spoilered in the corresponding day's spoiler thread.
im trying
it has an or in it though ||
You don't need to use spoiler tags if you post it in the spoiler thread
there is a spoiler thread?
Choose the corresponding day's thread and post there
#1446014192858697748 <- for example
kk ty
what are you referring to?
2024 day 14 part 2
...what the hell
That one drove me mad
I will admit it did drive creative solutions though
But my preconception of what the Xmas tree might look like drove me to completely the wrong path
oh I think I have a solution aproach
||modular arithmetic tricks:
- the x-coordinate distribution obviously repeats every 101 steps
- y every 103
- you can see the pattern along one axis in some rendered images
- chinese remainder theorem||
aaand it worked
The trick I used was ||looking for a bunch of pixels in a row||
Then I wanted to formalize it so I went with ||entropy measured by compressibility||
the way i originally solved that one was by generating a movie of the positions over time then staring at it lol, i did do a CRT version afterwards, but it was very memorable just playing around with it
this is a .gif of near the relevant time π
btw I feel like this should be spoiler-tagged
i think i just took the ||minimum of the variance|| and that worked
lmao, currently doing 2015 day 25...
advent of code? more like advent of paper
advent of paper and modular arithmetic solvable with a single ||pow call||
about to try again at day 3
try again?
i never finished it lol
oh wow day 4 looks fun /j
finished what?
day 3
that was a way older one
oh right lol
(2024/14/p2)
try formalizing exactly under what conditions one number, expressed in decimal, is larger than another number of equal length
i made an insane assumption on day 2024/14 and it paid off
what lol
7452743069371751078107071070707120193107810
7426873278616578327865716857891378613278631
which number is larger?
why?
first one
how do you know?
the 3rd digit is higher and the 1st and 2nd are the same
therefore no matter what precedes it, its higher
and, assuming you want to find out the highest possible number, you must thus
ive got a method working rn
just made my code work
its not doing whatever youre hinting at though
ive taken another approach
which is?
|| iterate over each line and finding the highest digit, then search again to find the highest digit that comes after it ||
you can stop early if you find a 9
?!?!?!?!??!!??!?!?!?
YO?!?!
easter egg in the input?
this is so cool like genuinely
that's from last year, the problem was to find the tree
thats sick
have you been making animations for AOC
for a while
yeah, it was a cool problem
was not my favorite one
my first aoc was 2019, i started making visualizations that first year!
What made you start with AOC
this server
thats cute
|| i mean it iterates all the way. it will never replace the first 9 as i use a > operator not >= ||

||it also never goes all the way to the end, it stops at the 2nd to last digit ||
me too
I'm def doing it
it's a great event not just because of the problems, but because so many people participate in the discussions of the problems
I SOLVED DAY 3
grats!
I agree, doing it solitude is def not fun its about the community
sharing
day 1: struggled alot
day 2: managed but needed help tweaking
day 3: all by myself
good news is, day 4 is probably the easiest so far?
hmmm...
funny idea
Advent(2) in Python
i still think 2019 was the greatest year for AoC
yeah
thats what i like to hear
except i havent finished day 3 yet
i got this duck profile thing cuz of it
still gotta do part 2
intcode machine was so much fun
ive only done 2024 and 2018, did 2018 together with a few other folks just a few months ago and it had some really fun problems, like with the water dripping from cavern ceiling and filling reservoirs, and some goblins vs elves games, i bet you did some fun visualizations for those lol
i haven't done 2018 yet
ooh youre in for a treat
past day 4 anyway
there was a filling one in 2022 though
recursive structure
hmm || can i find the first 3 lowest digits and just cancel them out? ||
so cool
my first visuals just used curses
what happens when ||123898765432111||
how did you solve p1
you're making me wanna solve the older aocs π©
|| well im thinking that the algorithm first detects 123, doesnt replace them until it encounters 2 in which it replaces 3 with 2 to become 1, 2, 2 but then it encouters the 3 1s and replaces the 2 2's to become 1, 1, 1 so it will cancel out the first 1, second 1 and third 1, leaving the 1 at the end ||
@mossy basin this is the water one, maybe my favorite aoc problem ive seen so far, visualization for it would be cool
https://adventofcode.com/2018/day/17
curses is cool for interactivity, but you can't really beat PIL-generated gifs imho
A lot of people said they made that assumption and tbh I have no idea why
i made it because it was the first thing i thought of and i figured i would think of something else while it was running
post-assumption, you can justify it -- do you know the birthday problem?
23 people in a room means 50% chance 2 share a birthday?
yeah
so if the grid positions are birthdays you can kind of guess that it's very improbable for none of the particles to not share a birthday
just so I'm not misunderstanding you what would be the final result produced by your hypothetical algorithm
(work it out so you don't just say the correct answer because you presume your algorithm to be correct)
|| for your example the highlighted digits would be removed 123898765432111 ||
right, that leaves you with ||238987654321|| but the answer would be ||987654321111||
oh yeah lol
So the idea is that if such an improbable frame exists, it is likely to be "special" in the way we want as well?
so it is gonna be like this
that's right, but this is just a post hoc explanation of why it works
you're getting somewhere with the ||replace if smaller idea, not the final answer but right direction||
pre hoc, it was a wild guess
i cant think of how id come to that answer
btw salt-die, is there any font \ font family you recommend using in particular? i notice some characters from custom_button example and line_plot dont show up with what i currently have
Consolas, 'Courier New', monospace
are these sextant and octant characters?
ya
yeah, octants are newest unicode, not widely supported, lemme see what font i'm using
the examples that come with this library are so inspiring
i think they added octants like a year ago or so
or maybe i got the one from here https://www.nerdfonts.com/font-downloads
one of the caskaydiaCoves
actually don't remember anymore
NF probably means nerd font though
i think i use the one without ligatures for terminal
alright thanks
Why is today so hard all of a sudden
because ligatures can do weird things to terminal apps
you cant get an output of that
i still have no clue how to do it either lol
you think?
i feel this meme
I am not exactly sure how, but I finally got it
nice!
Do you go x y or y x π€
wait what day was this
#1445642836103004161 message was my solution
I think that's just a demo for his library
I should finally make my render-vulkan-to-framebuffer
usually, y, x so i can use it to index a 2d array directly
I do x y - because I like alphabetical order :)
i name the array x, and the coordinates x1 and xa
For Language Rouletters, do y'all want a dedicated catch-all thread for your solutions?
[x, y] but [y][x] :)
set of (x,y) pairs
I have a dataclass with x and y in that order
but yeah, I have far too many old aoc where I swap (x,y) to [y][x]
I like to have a dictionary keyed with complex numbers. Quite neat, but a bit weird
I mean I'm pretty sure my Grid class accepts both [x,y] and [y][x] lol
Never mind apparently it does not
Oops lmao
My SparseGrid is [x, y] though
[r, c], always [r, c]!
i decided to not do any optimization anymore... I'm going to do small brain AoC
I have my exams next week so I'm fighting my optimisation urges so hard
I failed at this on days 2 and 3
I love committing and pushing directly to my master branch for AOC - feels so wrong yet so right
I might unprotect my remote master just for the added thrill
Nah, the normal ones are fine
meanwhile in my code
grid.neighs(i, j).each do |y, x|
...
end
grid.π΄(i, j)
yeah, because if you think about how the puzzle would've been designed, they likely started with the Christmas tree and then sent it running
bruh 20 minutes
π
time for day 5 :D
<@&518565788744024082> Good morning! Day 5 is ready to be attempted. View it online now at https://adventofcode.com/2025/day/5. Good luck!
I was just about to go out-
Well too late to turn back now guess we're doing this one slightly late
let's goo
ez
Hey guys
but i wasted like 40 seconds due to 1 stupid wa
i was going to ||prefix sum line sweep, but i checked input it had 1e9 order ||
but yeah you can
riiiiiight
||coordinate compress or something||
i was like p2 is hella easy
what was ur approach
||naive in p1, merge intervals in p2||
Iβm thinking of a system where my masturbation career is turned into a currency. Can anyone help me with this?
mods?
alr it appears itll take me a while
I accidentally crashed pycharm with my brute force π
should i feel bad for not having gotten it yet
and having taken 10 minutes for p1
rip
yeah dude let's keep it appropriate
@hollow wharf hows it go
im gonna let it run maybe lmfao
added print statements for some reassurance
look at it
only gonna take a few hours
lets think of better fucking logic till then π
wow i think that was the fastest ive done one of these π
Congrats!
this ones ez
oof, looks like we're both in the same boat lol
how fast
high five
lets see
i just sat outside in the sun for a bit until i could think of something
my (very naive) timer still staying under a second despite my bad day 2 solution π
its still quite shaky tho
kinda sorta fast :3
im not like some of the gods around here
π€
My p2 is O(n) π
my p2 is non existent
i'm washed π₯
Iβm quite happy for today - I wrote P1 in such a way that P2 was a one liner
hello
exactly
Love it when that happens, and also got to reuse code from prior AOC while doing it
I had to watch a youtube video on ||interval merge algorithm|| but I think it was still better than day3 p2 
nvm its not linear bc i forgot ||sorting|| takes time lol, but its p fast
okay i wrote up some mock input
and i see some issues
so thats good thats progress
yall i took like 2 hours on day 2 being stuck on day 5 is fine i think
The day Iβve been βstuckβ on the most is still Day 1 (Part 2)
you know what, that's fair, I think I fumbled a lot on that too
I generally start to take a lot of time around day 13-14 so i was expecting it to be harder faster this time round considering we only get 12 days
but this year has been pretty decent so far
The first 5 days have basically matched a usual set of 5 days
yep
I'll probably go back to prev years after day 12
gotta collect all the stars
I started in 2024, and backtracked 2015. Got stuck on 2016 day 11 and abandoned it
2024 day 8 is the only one ive attempted so far where ive gotten none of the stars
I did 2 extremely dumb things π
summed the ranges instead of their lengths
and thought my 2nd answer for p2 after getting one wrong was the same and spent 10 mins debugging a non-existent issue
this is quite fun actually
it was only a few digits off so I didn't notice π
i mean im taking extremely long
reviewing that code now,,, don't think I want to rewrite that one again
Iβll have to check this one out now
but its cuz i have actual stuff to do
and im writing my own dummy input and checking stuff
fun
just wish i didnt feel like literally everyone else has doe it already lol
i know its just like a dozen of you
also im sure the code im gonna write is gonna be needlessly roundabout
but we can refine it later
dont even stress about it, thats the whole point of aoc : to try and break down the problems and figure out an algorithmic way to solve it
a lot of us solve stuff like this faster simply because weve done similar problems before, you odnt even know how much time I spent on aoc 2022 when i was first starting out
plus it feels super rewarding when you finally figure out the trick behind a certain problem
You are not allowed to use that command here. Please use the #aoc-bot-commands, #sir-lancebot-playground, #bot-commands channel(s) instead.
Either figuring out the trick - or coding up a solution to one of the more involved problems- will do it for me in terms of being rewarding
Real input or example?
I presume this is day 5 p2?
ok wait
i might be an idiot
i mean i am an idiot for writing THAT
but i might be more of one
but at least thats one issue lol
US
i was gonna be like 'how does one even do that'
proceeds to do it himself
yeah this cant be right either
maybe it is
it just looks like what i had previusly
|| actually, for p2 that could be right. its in the range of what i had ||
ok
Congrats!
yall wanna see some spaghetti code
ill post the spaghetti in spoilers
and then go make it better lol
Partly for this reason, I quit out of Discord until I solved each day
I don't want to know how bad I am
Until afterwards
I donβt like to have any information on any of the puzzles until I fully solve them so I avoid Discord for the same reason
Now more than half of my AoC solutions don't need any explicit parsing inputs; the automated parse guesser parses them well.
does anyone have some code for sortin g and merging lists of ranges?