#advent-of-code
1 messages ยท Page 28 of 1
that guy must be close to making actual jarvis ๐ญ
but seriously none of the top part 1 guys came on the part 2 leaderboard
because p2 wasn't a fairly routine "simulate the grid" problem
it's kinda plausible that someone just had a p1 implementation lying around tbh
yeah
the only kinda weird thing was that the movement inputs were on multiple lines for some reason
@magic oxide we're getting more $
what is AoC Gate Guardian role?
they just create the spoilers channel for each day when the global lb is filled
i finally solved 2023 d21 p2 ๐ญ
my god
idk what the expected solution is but mine is terrible
huh okay the solutions i see on reddit are almost equally terrible
basically if you ||get the number for 1, 2, 3, ... blocks out there is a closed formula that describes it||
I did a ||difference table|| approach for fun to get the ||coefficients|| of the ||polynomial||
but yeah, the big thing that made that feasible are the ||"highways" going vertically and horizontally||
oh I remember why I did my approach
it was in reference to day 9 that year
as in "hey we can actually use that thing for this task"
day21/Main.java lines 68 to 69
// This is inefficient, but let's do a difference table
// extrapolation like in day 9 for fun.```
|| my approach was on a per-position basis. for each position, i bruteforced the min dists to that position in the shifted copies upto like 10 layers of copies. for the innermost 2-3 layers (round up to 5) its unpredictable but outwards from that the min dists to that point increase in multiples of the grid size, so theres closed form expressions to cover the next 202295 layers ||
||sample at 131*i + 65 steps and it's a nice polynomial||
||idk i dont trust interpolation for integer stuff||
I guess you're familiar with difference tables from day 9, stuff like this
1 4 9 16 25 36
3 5 7 9 11
2 2 2 2
0 0 0
you reach a constant/zero row and you can then continue filling things in
extrapolating the sequence
this reaching a row of zeroes happens for exactly sequences that are polynomials
there are other fun schemes, like ones to extract fibonacci-like recurrences, which is much more powerful than this
e.g. the berlekamp-massey algorithm
Files used in Advent of Code?
20
37
2
1 file per day
for me day 6 9 and 15 get an extra file for part 2
part 2 today is just rude
I had fun doing part 1 with only regex
excuse what
every single language from now on better have a hashmap and the complex type
fun fact, raku has its own regex syntax
using vlang and they dont have tuples... i wasnt too happy, especially cuz I like keeping coords in tuples for hashmap keys
are there aoc solutions posted anywhere?
1266/16657. Another day where I decided to sleep on it and come back in the morning. But I still solved it eventually.
I was half expecting the bot to push boxes into a Christmas tree today
The tree's are in the boxes. ๐
today is the most difficult part 2 for me so far... pray for me ๐
woah what is this character
i don't know how, but i somehow managed to write working code. only problem is it takes 10 minutes to compute LMFAO
i don't know how i managed that
was so stuck on part 2 for todayโs challenges because my robot got inside a box and forcefully ripped it in half
Inspect element
might do today in nim, why not
<@&518565788744024082> Good morning! Day 16 is ready to be attempted. View it online now at https://adventofcode.com/2024/day/16. Good luck!
You're in a hexagon tiling space with a quandary at hand
WHAT ARE THESE EDGE CASES
wait what edge cases are there
alright not too bad
esp given that i'm on a plane
Smart. Breaks help a whole lot. Learning to embrace that helped me a ton with projects where I got mentally stuck
yeah i spent like a huge chunk of time yesterday on day 12 purescript
and brain's kinda refusing to work
nvm, I just suck at grid based problems ๐ญ
876/400 :/
we'll get em next time
i think i may have written one of the most inefficient search algorithms of all time for day 16 part 1
it's probably one of your ||pruning parameters in part1||
i dont understand ppl participating in aoc. if you don't want people utilizing part of your solution then dont share them at all literally anywhere on the internet 
Part of showing off, and just sharing different solutions, as to gain insights from others.
im sharing all of my solutions copy them idc if you solved the theory of general relativity problem with it then ty i helped with that ๐
dont be a Scrooge its the holidays bro ๐
since when did nim became a language and not a game
all nim reminds me of is stupid grundy problems ๐
im really hoping tomorrow isn't also grid based, im kinda sick of them LOL
(incoming monkey paw curling and we get a 3d puzzle)
Or an infinitely recursive fractal grid, like 2019 day 20.
you fool now we'll get beacons 3.0
fractal-looking beacons on an infinite 3d grid with asteroids
and teleporters and keys!
Real, im so tired of these grid problems
and robots that arrange into multiple different shapes!
throw in some elephants and some rocks too
i kind of like grid problems
grid problems can be fun but like the last few days have only been grids
haven't even gotten our cellular automata problem yet
lets see 4,6,8,10,12,13(debatable),14,15,16 are grid problems
yeah they are abundant
but to be fair grid problems are a still a very wide field
mazes are scary
agreed. pathfinding problems in general are tricky
my program paused output for some reason
i don't know if i should be worried for a cycle
run it in debug. check where it hangs
oh
it's just proceeding ever so slowly
..i can just recursively define this, right
i think i'm kinda burnt out from doing purescript
functional programming is interesting, but day 12 was hard enough as it was
and then another grid problem today is 
2 approaches running at the same time because why not
oh no we didn't need to find shortest distance ๐คฆโโ๏ธ day16
do you have a seen set/dict ? if not cycing is certainly possible
i do have one
i'm gonna blame it on all the copying though
okay i found a faster way that takes like 10 minutes instead of an hour or so and so
there has to be a smarter way right-
iirc all problems from all years should have a solution that takes under 1 minute
some might take a few seconds even with an optimal solution though
Yes. A typical solution should work under a few seconds here.
Hullo!
Gotta get back to it 
๐
some might take a few seconds even with an optimal solution though
huh?
the years I was learning rust I was well <1s in total across all days
Looking at my 30mins python and 7mins30s csharp
...
the rule of thumb is at most 30 seconds in a slow interpreter.
even that seems immensely slow
isn't the rule of thumb this line
at most 15 seconds on ten-year-old hardware
(for people with more than a little problem solving skills)
For Day 16: (no coding as of yet) but I'm trying to come up with different concept by ||creating a node into graph network...At every time there is a fork, there shall be a coordinates of maze and when it is branched out, there shall be a coordinates of the next step, the same is true for another branches...However, there shall not be any coordinates for the long shaft of wall until there is another intersection/fork (and that's where we create another node and making a link between)...And so on and so forth until I have a complete graph network of the maze. Then what's left of it...is just by learning which in between the S & E has the fewest node bridging between it.||
Guys, in the today's first example am I tripping or is the given shortest path not actually the shortest ?
Is there some rule I am missing ?
This is what I find as the shortest path
||```
# # # # # # # # # # # # #
. . . . . . . # x x x x x
. # . # # # . # x # # # .
. . . . . # . # x x x # .
. # # # . # # # # # x # .
. # . # . . . . x x x # .
. # . # # # # # x # # # .
. . . . x x x x x . . # .
# # . # x # # # # # . # .
. . . # x . . . . # . # .
. # . # x # # # . # . # .
x x x x x # . . . # . # .
x # # # . # . # . # . # .
S . . # . . . . . # . . .
# # # # # # # # # # # # #
28 Steps
||read the bit about scores again||
I am not calculating the scores here though, just the steps
I should be getting 36 no ?
||you're supposed to find the path with the least score, not least steps.||
@mild hill (Number of steps) + 1000*(Number of Turn + 1 for initial forward) = Total Score
Come onnnnn I hate those grid challenges
I had the same issue, spent an hour on it. For me it was because of the random newline characters in the instructions, which somehow didn't affect the answer on the example, but obviously did for the big one. Idk why they even exist, but just make sure your code accounts for the "\n"s.
same boat lol, been having a fever
will get back to it when i'm feeling better
I didn't get enough sleep so today probably won't go great
drivers start your engines lol
<@&518565788744024082> Good morning! Day 17 is ready to be attempted. View it online now at https://adventofcode.com/2024/day/17. Good luck!
lie
frrrrrrrrrrr
are y'all using some ||data structure||??
yea
they're just not fast enough
||brute force.......||
potentially not ideal but......
why tf is it failling
yes
another day of sample works tc doesnt smh
||are your opcodes 1 and 4 correct?||
lmao thanks
||i forgot to do something in 4th opcode||
||i was updating the integer variable C, not the list i created||
503/41!!!
Nice
Time to catch up on the last 2 days now
This is the first time I feel like my top 100 is deserved
||Is bf second part possible||
what data structure are you even using??
if you have while loops in your solution you're basically brute forcing a solution that is not logically sound
am I allowed to share this yet?
||it has more than 6 digits?||
leaderboard is full
Umm yep lb just full
ah yes ok
||eg infinite loops||
||DFS extaspacesoitsnotsuspicious||
||for bxl/opcode 1, do i write it in binary representation or just decimal to b? ex. 3 or 011?||
||You just have to store the number||
thank you!
diabolical problem today
i was waiting for the opcode problem honestly
took exactly an hour to solve p2 ๐ญ
||hey so what do i do if my input results in an infinite loop? asking for a friend||
update: nvm i accidentally used an i instead of a j and didn't notice because i don't have my glasses on
Much more
how many?
im completely stuck with part 2
Mine had ||15 digits||
||so brute forcing today is impossible, understood||
In most AOC years (including this year) if they give you a programming language that you have to implement and run for part1, part2 requires ||studying your input to figure out what the given code is doing||. Drove me craze in my first AoC year before realizing that.
added a note-to-self for future me lol:
def main():
print("warning: unless you want to be computing this for the next ~90 years, don't run this on the input data")
rip mine had ||16||
edit: oops i thought you were talking about input digits, not output for p2
im a newb ๐ the ||input data is literally less than 10 lines of information||
i did the math (based on someone's estimation that the part 2 output is roughly correlated to some formula) for ||16 digits|| and found that if ||your solution is 100x faster than my (unoptimized) python solution, running on 32 cores|| it will take roughly ||10 days||
so not impossible but definitely not something you want to brute force
well, time to get to reverse engineering
however my math is probably wrong, as usual
we're programmers, if we get something right on the first try something is wrong
im upgrading my software packages leaderboards can wait
this was the most difficult one this year so far for me, good luck to everyone who hasn't attempted it yet o7
how'd you do it? i'm curious
i feel like the way i did it was insanely hacky
like most people did
||bruteforce in packets of 3 bits recursively||
||same||
just go to the spoiler channel ๐
||i wonder if there's an input out there where that approach wouldn't work?||
well my program basically did ||A >> 3 every time and the program is 16 numbers so A must be at least 8^15||
so ||2^45||
I don't really know if you can do this for some arbitrary program
prob no
I don't have an idea how to write code for it either
I imagine it would be very complicated if you can jmp to odd position but my program didn't have that
||ediio||
:^)
finally got it
feels good when I first tried the answer
without having to spent hours debugging
@minor cave I have the bestest idea, I'm guessing you might already have ||python as the last day|| but what about ||python 0.9.1||
what about ||pypy|| ๐
here are my thoughts on language roulette so far
Lmfao this is incredible
oh wow, this sums up every single language that has come up
lean is the only one in there that hasn't appeared
but i didn't really want gleam to be the only ok functional language
Question. What's your total time for day 5 part 1 and 2?
I got 0.009589757000867394 and was wondering if others got sth much better.
Spoilers 
Not giving the solution though, just asking how long it took.
in Python? mine is 0.3s for both to run
In python?
yeah
what was day 5 again?
Could I see your solution?
The rules and updates one.
23|53.
Had data like that.
that was...err...pascal?
Could I see your solution?
sent it in the thread
using time I see like 10ish ms with gforth, but I suspect I can't trust time to give me too useful resolution
I've started remembering the problems based on the roulette language used ok
I'm not damaged
I swear
how do you run forth?
specifically how do you time it
because iirc i was running it via repl
My initial solution (both parts) was ~0.2s, down to ~0.003s with a few optimizations
Nice!
Could I see the solution please? Trying to learn.
definitely not plotting to take all of you down after stealing your techniques
time gforth main.fs -e bye < input
so I'm measuring with a bunch of overhead of random stuff
I did a 100 * 100 lookup table to do comparisons in not O(terrible) time
4-5 hours later, finally got the part 2 solution ||I was doing one way and then tried doing the opposite and it worked fine lmao||
7 hours for new day
Is it completely free?
Cuse 2nd day the firefox browser doesn't seem to work just kept buffering for 2 days
AoC is free, yes. Are you saying the day 2 page isn't loading for you? That seems unrelated. I can load it fine.
No the page is loading but the firefox browser in the VM isn't working
To open elastic SIEM
Sorry, how is this related to Advent of Code?
Cuse it's an issue that came up in the 2nd day of AOC room ig
Wait isn't this Advent of Christmas of THM?
if it's so free then get on the leaderboard ๐
it is not
Ohh my bad
No, TryHackMe's event is different. This channel is about Advent of Code. https://adventofcode.com/2024
Ahh cool lme check
Today's part 2: WILDLY fun
It has reminded me how fascinating I find compilers... Is the dragon book worth reading still? I kind of want to get my hands on a copy but they seem pretty expensive
I think it's a nice book. If you want a more to-the-point/practical introduction, Crafting Interpreters is great.
advent of code gods, please bless me with an easy one today, i have so much work ๐ญ
same
thanks, Maybe I'll start with that one ๐
<@&518565788744024082> Good morning! Day 18 is ready to be attempted. View it online now at https://adventofcode.com/2024/day/18. Good luck!
truly the Advent of Grid

enough with the GRIDS alreaduy
no more!!!
Provided to YouTube by Universal Music Group
The Grid (From "TRON: Legacy"/Score) ยท Daft Punk
TRON: Legacy
โ 2010 Walt Disney Records
Released on: 2010-01-01
Unknown, Other, Producer: Daft Punk
Unknown, Other: Alan Meyerson
Unknown, Other, Producer: Mitchell Leib
Unknown, Other: Pat Sullivan
Producer: Thomas Bangalter
Producer: Guy-Manuel d...
its giving https://youtu.be/fuEJWmxWkKw?t=7
ReBoot is a Canadian CGI-animated action-adventure cartoon series that originally aired from 1994 to 2001. It was produced by Vancouver-based production company Mainframe Entertainment, Alliance Communications, BLT Productions and created by Gavin Blair, Ian Pearson, Phil Mitchell and John Grace, with the visuals designed by Brendan McCarthy aft...
part 2 please don't be evil
Hahaha When I saw 'nanosecond' was a link I was like "I bet thats RADM Grace Hopper".
428/206 :/
how bad is part 2 on a scale from 1 to 10
||fairly straightforward||
||simple enough that BF can work||
this.
starwort is 0o31
I mean I got 173/171
oh lol nice
Draw your own conclusions
thank goodness, i really needed time today
i made it to global
Oh nice
Advent of Grids
totally lost on part 1
i'm tired of grid based problems :/
I'm slow at them and they completely messed up my ranking in the past 4 days
you should use aoc-helper, it comes with a handy dandy Grid class
Haha same. Doesn't help that I code everything from scratch each day ๐
i want to share my ranking with the python community we all ranked ๐ซถ
how to pathfind
oh my god it was easier to implement the algorithm from wikipedia
wow
i'm so dumb
ยป args-kwargs
ยป async-await
ยป blocking
ยป botvar
ยป class
ยป classmethod
ยป codeblock
ยป comparison
ยป contribute
ยป customchecks
ยป customcooldown
ยป customhelp
ยป dashmpip
ยป decorators
Oops, what I even typed
god damn it i always wake up late on easy days
can part 2 be bruteforced?
||yes||
||yes||
||im very grateful||
||solved both, time to relax for the next 23 hours||
i still have part 2 from yesterday to do. i'll tackle that in the morning
This was weirdly easy for week 3
maybe it was an apology for yesterday
hardest problem imo
so grateful
i was so worried when reading it lol
same
Try not to make a grid challenge yet again challenge impossible
honestly thought p2 would be ||find shortest path where every step you take, a new block drops||
yeah same
tho that would've been too easy ig
Day 18 ||networkx|| to the rescuuuuuuue 
i thought it would be blocks going down every second due to gravity in y
I thought it was gonna be both ๐ซ
||Took me some time to confirm it's not gravity simulation (cuz without it's easy but with gravity it's too hard)||
i was honestly expecting something along the lines of ||every step you take, the next byte falls into place||
but yeah this was significantly easier than expected
especially this late
||every step you take every move you make ๐ถ ||
Yeah i was thinking this + ||a byte dissappears after X steps||
oh and i would have the question ||when is the latest time you start so that you can still make it.||
honestly quite lots of people thought about that
200k+ to 20k+ in day 18 sheesh might need to have tiered levels for the events based on difficulty no?
?
Day 1 200k+ participants completed the puzzles. Day 18 only 20k+ so far
161k you mean?
ah edited to day 18
well, compare with other years and it's exactly the same trend:
Ow my eyes thatโs too many numbers Krypton ๐
Yeah wait, trying to make it smaller x)
Yeah this is expected. The puzzles do get more difficulty as it goes on and as things get closer to the holidays people's schedules get fickle
It's not a bad thing. The days towards the end are supposed to be more challenging
2023 differences
2022
2021
it's currently also at a fairly normal state
people stop solving them either because of lack of time, motivation or knowledge
sometimes people even forget about it, especially people that do it for the first time
they read somewhere it exists, solved the first (maybe second) day and then forget about it or doesn't like it
Reminds me of a marathon really cool event
Does AoC do prizes? Or merch or something
Iโm surprised big tech hasnโt jumped on this as a marketing opportunity
They have merch you can buy, but no prizes. The event is just for fun
https://cottonbureau.com/people/advent-of-code
Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like.
they have sponsors
some communities make private leaderboards and then distribute prizes, but there's no prize for global leaderboard
"I did the AoC roulette and all I got was this ||pink role||"
What is AoC roulette
Doing AoC in a different language every day -> https://discord.com/channels/267624335836053506/1312400095123341465
How do I participate the channel is read-only on my end Iโm a newb x)
The channel is just an announcement telling you which language to use when solving the puzzles
Ah I see hmm
Someone said advent of bruteforce the other day idremeber which day it was 
https://cppnorth.ca/
Advent of Code: Behind the Scenes
Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like. People use them as a speed contest, interview prep, company training, university coursework, practice problems, or to ...
(Don't think I saw this posted , it's two weeks new)
Is this recent? I feel like I've watched this talk?
It says 2 weeks?
Yeah, I've just seen this graphs and all this before. Looks like maybe a talk he gave before, just presented it newly again.
(Looks like the conference was in July, but just posted videos)
he also did a behind-the-scenes talk in 2021 IIRC
Ooh, he shows something from @cyan sleet at 30:59
I was hoping to see something from salt die
good luck everyone, final week starting in 3 minutes o7
<@&518565788744024082> Good morning! Day 19 is ready to be attempted. View it online now at https://adventofcode.com/2024/day/19. Good luck!
please don't let part 2 be too bad
how bad was part 2 from 1 to 10
2
minor roadblock when i just changed what i thought i needed to from part 1
but the first (and most obvious) solution, without giving too much away, worked flawlessly
wtf thats it
god damn it i || fucking messed up parsing due to splitting by ',' and not ', ' and my dp[-1] was giving 0||
its all Eric's fault
i cant help but feel like this is to lure us into a false sense of security
so are we looking for a Historian or Santa Clause or something. this is my first year doing aoc
isn't day 20 usually the evil one
i feel like thats on average the worst one
same
okay lmao i too remembe
the coordinates hell
Literally in the middle of nowhere. Somehow got internet access and leaderboarded. 48/50 ๐ญ
thankfully a somewhat easier day
๐ฆ beacons/scanners was one of my favorites.
oh the concept is awesome. its just very hard
Got to make a Beacon class.
||
class Beacon(tuple):
def __add__(p1,p2): return Beacon((a+b for a,b in zip(p1,p2)))
def __sub__(p1,p2): return Beacon((a-b for a,b in zip(p1,p2)))
def rotate(s,a,b,c,i,j,k): return Beacon((a*s[i],b*s[j],c*s[k]))
||
i'm glad it has unlimited towels of the same same pattern. would have been annoying otherwise
(for part 1)
Overall difficulty (part1 + part2) for me (higher rank = more difficult):
||```
Day 16 (maze problem)
Day 14 (christmas tree; u need to spend a long time on it)
Day 12 (garden group)
Day 13 (claw machine; it is a math problem)
Day 17 (3 bit pc)
Day 15 (push box)
rest of the day are easier than these
damn, my answer is correct for a different input, but not mine. So i'm close, but not close enough. My code works for the example, hmmmm
-# edit - i figured out the issue
||memoization banger||
i found that day 14 much easier
silly way of doing part 2 though
cool script runner! howโd you get it to look cool like that?
Oh that's just hyperfine for the benchmarks
At first I calculated myself, but then discovered that tool
Run it multiple times to get that mean, min and max
it grows

oh god that was a long time ago
neat
that was such a monstrous 6 day stretch
you know the phrase "calm before the storm"
also huh, TIL every day's description has a secret hidden word that when hovered over provides some extra flavor text
||hover over the word "stripe" right before when the colors are listed in today's description... turns out there's one of these for every single day so far||
||userscript for highlighting when||?
||the website automatically does this when you get all 50 stars for that year!||
agreed
interesting, apparently I don't have ruby installed on my desktop
||styled em and span elements differently||
oh you ||highlight them by adding this to css||
||```css
em {
background: red;
}
span {
background: green;
}
start todays
this seems simple
implement very simple brute force solution for test input
works great
look at actual input
ohno.jpg
try to run brute force solution?
computer melts
dynamic programming it is
i looked at p1 and was thought p2 was gonna be like ||oh no now each towel is duplicated 15 billion times||
||Day 3 of @cache||
These channels have been quiet the last couple days. Are people just dropping off?
im working on solving advent of code in goboscript
been fairly easy days recently, solved quite quickly by lots of people and then moved on with the daily life things
and others may have stopped indeed
(which is a language i made that compiles into scratch)
its christmas soon wth
I guess so. Like with every year
To be fair i'm usually dropped off by this point
probably
though in my case iโve already finished todayโs problems so iโm out and about doing other things until the next dayโs set gets released
these are actually hilarious
the do_not_mul with the mul being highlighted
and the undo() here
yes
wait the numbers still seem a lot bigger ngl
good luck everyone, 20's usually the worst from what i've seen and heard ๐
<@&518565788744024082> Good morning! Day 20 is ready to be attempted. View it online now at https://adventofcode.com/2024/day/20. Good luck!
this truly is the advent of grid
advent of BFS
nooo i have to wait 4 minutes lol
welp there goes lb for me
found this cool new algorithm tho i wanna see what it does
you beat me to lbs lol
i think i will start just not caring about leaderboards anymore
Also, my dumbass had 1411 as the answer and typed out 1412 (not my actual answers) and got a 1 minute penalty on part 1 ๐ญ
neither did I until this AoC when I actually started leaderboarding and am in top 100 global lol
dang 151 for p2 isn't bad
congrats!
yeh i got global past 2 days its getting eehh
my dumbass ||thought through it, wrote >= 100, then changed it to > 0 for the test input, and then changed it back to > 100 and lost like 5 mins||
truly an advent of "make a grid util"
i wasted time with a non-bug TT
How dare you summon this puzzle /j
at least it isn't 2019
this one wasn't too bad, tho ||my runtime for p2 is terrible||
||@cache|| doesn't help me here..
this challenge would be perfect for people interested in robotics
Well it didn't help that ||I accidentally turned the goal into a wall|| ๐คฆ
3300/1400 
i just realized something. graph neural networks
gl those who haven't completed the puzzles you got this
today was nice !
858/1782
today wasn't as bad as i thought
are there any crossroads in grid day20?
||no. ||
omg off by 1 is like daily routine ๐คฆโโ๏ธ forgot to remove E from grid...
this is my first year attempting
my solution for part 1 runs in 5 minutes, but if it works it works
โญ
@fervent anchor
Can u elaborate about your project?
it's a machine learning project I have to send tomorrow
Mega project due tomorrow? I hope you started ๐
it's the final date
@modern terrace help me
if char != '#' ๐
I think you meant to ask this in #discord-bots
thats before even solving just to remember start and end
just saying, I didn't remove anything
TGIF time to catch up on AoC ๐ฅ anyone else also behind now? I'm on day 17 p2 reverse engineering my registers
my friend helped me
i was doing condition1 or condition2 while i had to do condition1 + condition2
13 minutes until i decide if today is worth my one hour before i leave
Good luck everyone
4 minutes until I decide if I just go back to sleep and wake up 2 hours later to solve it instead
<@&518565788744024082> Good morning! Day 21 is ready to be attempted. View it online now at https://adventofcode.com/2024/day/21. Good luck!
yeah nope I am going back to sleep for 2h
The moment I read it I was like "hey I've seen this before" ||https://www.youtube.com/watch?v=X4YHpZ0EfOE||
Did some runs today and beat my PB on every level, and since they're short I compiled them into one video, a segmented any% run of sorts. Doing all of these back to back would be hell right now so no thanks.
0:00 Level 1 in 16s 550ms
0:20 Level 2 in 1m 09s 800ms
1:33 Level 3 in 1m 03s 433ms
2:42 Level 4 in 33s 767ms
Previous PBs:
LVL 1 https:/...
so we have:
||
The numereric keypad that control by robot 1 that is depressurized
The directional keypad to control robot 1 by robot 2 that is in high levels of radiation
The directional keypad to control robot 2 by robot 3 that is in -40 degrees
The directional keypad to control robot 3 by you in an area full of historian
||
I got a smaller result (from the example given)๐
I have an idea but gn
i might try this manually at this point
How on earth do people do these so quickly
This is ridiculous
looks like ||they referenced numerous aoc challenges from years past||
already have a 5 min penalty now :/
6 people finished day 21 already wth ๐ are they bots or something
these puzzles are so cap -40 degrees what farenheit or celsius wth Eric ๐
i think everyone ||has the same input||
123/14
finally!
weirdly, chatgpt helped a bit today
ru on this discords leaderboard?
how do I get on it? ๐ค
why not kelvin
i'm doubting your science skills more than coding skills
&aoc join
&aoc join
**```
&adventofcode
**Can also use:** `aoc`
*All of the Advent of Code commands.*
**Subcommands:**
**`adventofcode about`**
*Learn about Advent of Code*
**`adventofcode countdown`**
*Return time left until next day*
**`adventofcode link [aoc_name]`**
*Tie your Discord account with your Advent of Code name.*
**`adventofcode unlink`**
*Untie your Discord account from your Advent of Code name.*
at least i think so
oh yeah i think you have to link first
also do it in #aoc-bot-commands
hold up, how do I link my name tho?
yeh i am beginning to doubt the real-world logic of these aoc puzzles ๐
my code works for example input
but not the puzzle input๐ฟ
OOF. ||two same length, but different order, of sequences of button presses for the robot you're controlling can make your sequence of buttons presses shorter or longer|| ๐ญ
yes
I made it
rank 579, (the first time I got on lb)
||how is 379A 64 and not 68||
Perhaps I should have kept the /j
smh
||<<^^ instead of ^^<< somehow||
p2:
||length of string is already > 300,000 for 11 iterations||
I don think this method will work
happened to me as well ahah
i have to wait 6 mins still on part1 ๐
||Dont you need to keep track of both (str, len(str)) instead of just len(str)? maybe I am incorrect||
yeah itโs exponential like that
Not sure, just thinking of ideas
||if it is exponential then we have to use other method||
||even if you only retain the minimum length of the string after each iter, the length will still exceed 1,000,000||
the only thing exponential is the submission graph in the past few days ๐
||something like the stones wouldnโt work because position actually matters||
||are we talking about numeric pad||
||not sure but what i did was, we have to prioritize moving left right as much as we can before up down, after which if it was the left most column should go one more left, but this does not work smh||
will ||something like ^>^> make the final string shorter, in some cases?||
||um i am sure the answer is no||
what proof
||379A giving 68 for me||
My idea was ||right or up first because it's closer to A but apparently not||
Yea, ||the final arm will trace out ^A<<^^A>>AvvvA||
||I'm not doing any of that, just assume the optimal movements on the intermediate keypads are fixed||
heres some of the examples of 379A, len=64
||```
v<<A>>^AvA^A<vA<AA>>^AAvA^<A>AAvA^A<vA>^AA<A>A<vA<A>>^AAAvA^<A>A
v<<A>>^AvA^A<vA<AA>>^AAvA^<A>AAvA^A<vA^>AA<A>A<vA<A>>^AAA<A>vA^A
v<<A>>^AvA^A<vA<AA>>^AAvA<^A>AAvA^A<vA^>AA<A>Av<<A>A^>AAAvA<^A>A
v<<A>>^AvA^Av<A<AA>>^AAvA^<A>AAvA^A<vA^>AA<A>A<vA<A>>^AAA<A>vA^A
v<<A>>^AvA^A<vA<AA>>^AAvA<^A>AAvA^Av<A>^AA<A>Av<<A>A^>AAAvA^<A>A
v<<A>>^AvA^Av<A<AA>>^AAvA<^A>AAvA^A<vA>^AA<A>A<vA<A>>^AAAvA<^A>A
v<<A>>^AvA^Av<A<AA>>^AAvA<^A>AAvA^Av<A^>AA<A>Av<<A>A^>AAA<A>vA^A
v<<A>>^AvA^Av<A<AA>>^AAvA^<A>AAvA^Av<A^>AA<A>Av<A<A>>^AAA<Av>A^A
v<<A>>^AvA^Av<A<AA>>^AAvA^<A>AAvA^A<vA>^AA<A>Av<<A>A>^AAAvA^<A>A
v<<A>>^AvA^Av<A<AA>>^AAvA<^A>AAvA^A<vA>^AA<A>A<vA<A>>^AAA<Av>A^A
v<<A>>^AvA^A<vA<AA>>^AAvA^<A>AAvA^A<vA>^AA<A>Av<A<A>>^AAAvA<^A>A
v<<A>>^AvA^Av<A<AA>>^AAvA<^A>AAvA^Av<A^>AA<A>A<vA<A>>^AAA<A>vA^A
v<<A>>^AvA^A<vA<AA>>^AAvA^<A>AAvA^Av<A>^AA<A>A<vA<A>>^AAA<A>vA^A
v<<A>>^AvA^Av<A<AA>>^AAvA^<A>AAvA^A<vA>^AA<A>Av<A<A>>^AAA<A>vA^A
v<<A>>^AvA^Av<A<AA>>^AAvA<^A>AAvA^A<vA^>AA<A>A<vA<A>>^AAAvA<^A>A
v<<A>>^AvA^Av<A<AA>>^AAvA^<A>AAvA^A<vA^>AA<A>Av<<A>A>^AAAvA^<A>A
v<<A>>^AvA^A<vA<AA>>^AAvA<^A>AAvA^A<vA>^AA<A>Av<A<A>>^AAA<Av>A^A
v<<A>>^AvA^A<vA<AA>>^AAvA^<A>AAvA^A<vA>^AA<A>Av<<A>A^>AAAvA^<A>A
v<<A>>^AvA^Av<A<AA>>^AAvA<^A>AAvA^Av<A>^AA<A>Av<A<A>>^AAA<Av>A^A
I have a lot more answer than that btw
same for me, been trying to debug for the last half an hour and still not really sure what I'm doing wrong
Managed to narrow it down to one particular part
||```
379A:
depth 1
my code: ^A^^<<A>>AvvvA
correct: ^A<<^^A>>AvvvA
depth 2 v v (this part messes me up)
my code: <A>A<AAv<AA^>>AvAA^Av<AAA^>A
correct: <A>Av<<AA>^AA>AvAA^A<vAAA>^A
depth 3
my code: v<<A^>>AvA^Av<<A^>>AAv<A<A^>>AA<A>vAA^Av<A^>AA<A>Av<A<A^>>AAA<A>vA^A
correct: <v<A>>^AvA^A<vA<AA>>^AAvA<^A>AAvA^A<vA>^AA<A>A<v<A>A>^AAAvA<^A>A
some tips
||
so take a look of these if your result is wrong.
1: if one of the fromLocation and toLocation is in 0A^, what will be the possible paths?
2: if one of the fromLoc and toLoc is in 0A^ and the others is not at column 0 (i.e. in the column that doesnt contain a gap), what will be the possible paths?
3: if *none of them * is in 0A^, what will be the possible paths?
||
visual explaination for 1 and 2 (big spoiler for part 1)
||does this also imply for the directional pad||
||yes||
damn
||and those two paths in the second grid both lead to optimal score i suppose||
damn big spoiler wall today
Today ๐
||btw can anyone give some tips on today's part 2||
||I dont have any idea on how||
guys
did you do part 2?
jonathna paulson did it in 3 hours
what about you stickie?
my p2 soln is in https://discord.com/channels/267624335836053506/1319908014118928476 if anyone wants to look
Just finished. 5ms runtime for p2.
man youยดre the only one that has posted a solution
HAHAHAHAHAHA
haven't been working on it much
i'll prob finish it tonight
ok good news is I'm done I'll come back to do them soon
||yes (kinda)||
okay lmao now
||my memo code works for depth = 2 but too high answer for depth = 25||
weird
how cancer can this day be
||mess with your input path, the optimal one isn't the same for d=2 and d=25||
||i generated all input paths actually and am taking the min, but only for numeric keypad||
do i have to do this shit for || directional too|| smh smh smh
||yeah I had that from before||
welp
aight
hopefully the last cancerous thing to do today
woohooo
the ||modification was pretty quick all i had to do was run the same script again, cuz the forbidden coordinate is technically the same for both numeric and directional (-2, 0) for me || lmao
oh god finally
and I completed part2 instantly lmao
just forgot to cache the function as I was debugging
today might just be the first day i can't do. we'll see but i can't really make heads or tails of it yet. might also have to do with the fact that i'm not that comfortable with recursion
you know what i want my grid problems back XD less of a headache
this problem is just the right amount of fiddly to make me not want to focus on it
keep getting distracted
this is so real
i thought of a solution but thinking of making it just makes me say "eh, i'll do it later" for some reason
i tried working on it a bit in the afternoon and then spent 2 hours watching youtube instead
so true
wisdom of today, editing in vim over ssh connected to my desktop which in another country on a phone in a train that's going through tunnels is not optimal
bro is doing today's problem irl while doing today's problem
my attempt keeps undershooting for the example input
:D
FOUND THE ISSUE!
that one paragraph helped so much
now it's overshooting, which is totally fixable
just take the average of your two algorithms ๐
wisdom of the crowd
nvm undershooting again
today actually is advent of sit down and concentrate for 10 minutes
i think i've written like 3 lines of code in the last hour
I have a solution for p1, it's just written in pseudo C#
a rare time I need to write on paper
because I couldn't read docs reliably in the tunnels
so I just made up some methods and syntax
perfect.
I have yet to see what the p2 twist is, from your comments it sounds like it might be terrible ๐
10 minutes hours
passes the example input
it might be the best thing actually
at least p1 sounds like a wonderful fit for ||generator functions||
honestly i would've maybe enjoyed a functional language today
extra type safety seems kinda nice about now
in the mean time i'm trying to do 16 part 2... not that happy about this
C# isn't type safe enough? ๐
it's already midnight
there's no way i'm doing this in C# without a python sol first
for anyone, day 21, did ||test case 379A produce something different than what was given? I keep getting a length of 68 and not 64, but for all the other test cases, they are correct||
i had a lot of issues with that but ||it kept guessing below the actual length instead of above. depending on how your solution is set up, it may be a problem with finding the "ideal" paths between any two keys on the keypad||
using ||manhattan distance, then with that determining the path taken||
it'd be pretty difficult to diagnose the problem without seeing the code being run (especially in here since no real spoilers) but the best advice would probably be to reread the problem carefully, it places a few restrictions that might help trim down problematic cases
yes, this happens. ||two sequences of keypresses that are equivalent at one layer, like <<^^A vs ^^<<A, can take different number of keypresses to key in at the next layer up||
you found ||a solution, but not the shortest one.||
||found my error. I pass them now. Just not getting the correct answer for my input||
ack,, this is such a headache
this might be the day that i finally don't pass ๐
||is there a case where one sequence is always peferable over the other?||
(to my knowledge) no
||so there's cases where you might want >v over v> and vice versa||
i believe so?
iโm still trying to wrap my head around how the problem works, but my solution didnt attempt to solve this i think
||the optimal path can change between p1 and p2 even||
p1/p2?
parts 1 and 2 are slightly different
well part 2 is really just part 1 ++
yeah
i feel like...
part 2 could have honestly been harder
so im glad it was only what it was
Part2 took way too much effort and too many false starts and failed approaches, but I finally managed to solve it.
This was a weekend one, wasn
wasn't it. Here's hoping that after day22 it's relatively easier.
should be, if its anything like 2021
actually....
there is tomorrow.......
but its a sunday, and right before christmas
in his talk he mentions that he tends to put harder puzzles on weekends because people have more time
well today is going to be awful then
for day 21 part 1 do we need to account for ||the cursor not hovering over A when going to the 2nd, 3rd, 4th, etc line of the input||
just rolled out of bed
<@&518565788744024082> Good morning! Day 22 is ready to be attempted. View it online now at https://adventofcode.com/2024/day/22. Good luck!
Be nice to Sir Robin
HOW ๐ญ
I got the role like 2 years ago and have just been enduring the pings...
Damn that was easier than I thought lmao
You're also always welcome to ask in the #python-discussion channel, modmail, etc
we're so back
weeklong hiatus due to illness but got 45/7
don't think i'm getting back into the top 5 this time though 
rip


bruh no way they changed the test input for p2
i could've finished like 5 minutes ago
the king has returned ๐
no king just an arrogant peasant
what is up with aoc and old challenges. go live in the past then aoc
huh
well that was something
here i was thinking part 2 was gonna be something like ||"find the minimum starting value such that the 2000th price is 2024"||
i thought part 2 was gonna be ||find the 2 billionth price||
same
brute force in progress xd
anyone else getting that you have the correct answer for someone else?
I'm definitely using my own input, and my p1 was accepted
sure
lets do that
nvm it takes forever to even finish 1 ๐ญ
what if it was ||finding when the secret loops||
I don't think the bitwise ops have anything to do with part2 on the surface
or does it
is it guaranteed to happen
wow
this would just be ||visisted set and pray||
yes
for any one number, the 100 millionth iteration takes 25 seconds
right there's mod
yeag
||you can prove it with the pigeonhole principle since there are 2^24 possibilities and the evolution process is a function (same input = same output)||
how many cores are you using
im gonna be so real with you
i have no idea how to check
ive just been gunning these for however long they took
oh wait
actually tbh idk why i asked i'm not sure if this can be parallelized lol
multiprocessig would def work
different processes for individual numbers?
how are you getting the numbers
i mean from the input
oh yeah
my brain still not in peak form it seems
enough
are we feeling daring...... ||1714?||
yeah you should be able to do that
parallelism will only help you up to how many cores you have
but processes are an abstraction so it's ok
Could you reduce that by 4x with simd?
probably wanna tell them to use threads instead of processes first lol
at least that can be done without 3rd party libraries
we're already breaking importless with multiprocessing :P
there's def some optimization that could be done though
i feel like python perhaps isn't the right language if we're interested in optimization
I gave up. i'm implementing ML/DL approaches now on my own input data no lb for me today
c++ or rust might be more like it
i'm curious ||how often cycles happen||
for 2021, whichever day was the one where you had a maze that repeated itself some number of times
might ||run floyd's a bit later and see||
my part 2 solution for that day ran for nearly 3 hours straight
don't even need ||floyd's|| since it's ||deterministic||
maybe that's not the right word
that's why i said it's not the right word
what if it has deterministic ||for robert to work on x)||
um why it doesnt work
you're better off making it iterative
food for thought
||if you treat the ints as elements of the vector space (Z/2Z)^24, then bitshifting is a linear operator and xor is addition
so getting the next secret number looks like a product of 3 (I + B) terms, which is also a matrix
so you could do fast pow||
crazy
in just 90 minutes, there have been 35% of the full day completions today than there have been total for yesterday
omgerd that puzzle was annoying ๐
ah yes, the perfect setup
some back-of-the-napkin math shows that my part 2 solution for today will take 4 hours to complete
this would be tolerable once i get multiprocessing running on all 16 cores
that's going to be a task for me in the morning
(i could have it running all night, but then i have to deal with my computer lights and my room being hot)
is this 9 minutes or 9 seconds?
if it is 9 minutes then why the next one is 54 minutes

Whats this?
global leaderboard
For what
day1
9 seconds
even faster than chatGPT ๐ฟ
if u use chatGPT it takes at least 30 seconds and may not be correct
๐ฅด
what are you even doing?
Probably similar, but better, things than I was doing on my first swipe at it. ๐ My first swipe at pt2 was going to take 8hrs (according to my tqdm progress bar), so while it was running, I rewrote the whole thing and now it takes 2.4s. ๐
AOC bug moment:
6 [[[...], [...], [...], [...], [...], [...], [...], [...], [...]], [[...], [...], [...], [...], [...], [...], [...], [...], [...]], [[...], [...], [...], [...], [...], [...], [...], [...], [...]], [[...], [...], [...], [...], [...], [...], [...], [...], [...]]]
[[...], [...], [...], [...], [...], [...], [...], [...], [...]]
day21 part1 runs in 0.0003s part2 is running for 10+ mins already xD
I fear it may not finish for a while
i made a solution for today that works on everything i've tested it on (even someone elses input) EXCEPT my own input
going insane
what am I even meant to do about this
parsing or off by1
i copy pasted their input the same way i do mine so parsing should be fine
and it's not off by 1 i tried it as a joke the site says it's more than 5 off
there must be some weird edge case in my input that doesn't appear in theirs
and i have no idea what i am supposed to do about it
i even looked at how others did it and it's litearlly the exact same solution idea
it just works for them and not for me
Make sure ||you are getting the price at the end of the sequence you find|| or make sure ||you are getting only the first price find by that sequence||
i do both of those
i have no clue

i just ran someone elses solution, and it also gives my answer (which is apparently wrong)
funky edge case somewhere i assume
maybe ||you're missing the first price?||
unsure how that would happen
I found the issue
||if the sequence was the very first 4 differences my code skipped it on accident, and this happened to be the case on exactly one number. this just isn't the case for some inputs so yea||
What is the best plan to learn Python?
Find a project youd like to do and research of how to make it in python
solve all of advent of code in python
yeah ||this is what i meant by missing the first price||
||i had the same bug||
oh
if only i read that correctly

that would've saved a lot of time
actualyl 15m isn't that crazy but still
just finding a passion project and going through with it will alone teach you incredible amounts of techniques, tips and tricks. it's amazing to start there
passion project is fine when possible but you cannot force passion
what you can force is discipline
if sufficiently disciplined you could try reading through the documentation
or watch a yt series
||going through every possible combination from -9 -9 -9 -9 to 9 9 9 9 then finding the โscoreโ at the combination. then print the max score||
๐ฅด
how else am i supposed to do it?
you do things ||the other way around||
rather than ||choosing a value and seeing what the scores it produces for a sequence|| you ||look at a sequence|| and ||see what scores/values it can produce||
||but wouldnโt i have to check basically all sequences anyway? iโd imagine thereโs so many numbers that basically every sequence comes up||
with your approach you ||process every sequence a quite large number of times||
||19**4 times||
with the other approach you just ||process once but with some slightly more expensive processing||
||i precompute the sequences and their deltas so thatโs not a concern, right?||
that doesn't change much, you're still ||going through all that ~19**4 times||
you can ||extract all possible non-zero scores/values for one sequence by only going through it once||
is it expected to be smooth sailing for the rest of the calendar
yo day18 was so ez. I copy pasta my day 16 code for the most part
I was so shook after day 17
i guess on to 19
which day was the hardest for you?
19 isnt so bad
its more reliant on concepts from earlier days
yeah holymoly 17 had me to tears
I was writing down my modulos and bit shifts on a piece of paper for hours
yeahhhh
17 was hard on me execution wise
21 was hard on me conceptually
but once i got it the execution is somewhat straightforward
have you done all the previous years too?
it's joever

