#AdVENt of Code
1 messages Β· Page 10 of 1
nop
I guess
how is this 6 steps
AOC on drugs wtf
Advent of guh
am I missing something
@real hinge java LSP
ITS 2 STEPS
oh guh java foricng me to handle exceptions
isn't it AAA -> BBB -> AAA(LLR) -> ZZZ
I also have no idea how it is 6 steps
you can take infinite steps technically
mantika mold
Ya
but that just goes back to AAA
molding my mantika ama
right of AAA is b
LLR just makes it go back to BBB
okay so if we first execute the instructions at the top
I might do this in uoua
might have something to do with the repeating part??
you can go forever with that
yeah so idk when to break out of that
bro i think my part 2 has been working this whole time but just takes extremely long
Does that even have aaa and zzz
i eat rocks
HOW
ugh I'm so mad I was counting my steps off my one so I thought that the cycles didn't perfectly repeat starting at 0
so i did a whole thing to check for remainders and do chinese remainder theorem
and then I realized I was just off by one on every step

CO PILOT GO AWAY
yummy
i can't tell if I looped it or if its just long
Oh I get it
me neither
AAA(start) β BBB(L from A) β AAA(L from B) β BBB (R from A) β AAA(L from B) β BBB(L from B) β ZZZ(R from B)
but i dont think its looping
my single-threaded program is certainly torturing that poor cpu core
If someone doesnt visualize it by tmr
part 1 shouldnt loop
I will
Are they supposed to be spatially possible?
Not strictly with left and right probably
yeah
ok im going to edit my program to show some sort of progress hopefully and leave the original running
just in case
I'll see maybe
how does R in BBB wents back to A
I have 8 cpu cores I can run 8 of these and it'd be fine
doesn't R in BBB go to ZZZ
shit yea its looping
yes
oh god people already solved problems and we are disscussing about the examples still

WAIT I THINK PART 2 MIGHT BE 1 TRILLION ELEPHANTS
nvm lb is already capped so it probably isnt
wait shit that's wrong lmao
uhg
hmm
idk I am not gonna use my brain power for this
i liked todays
part1 ||17621||, part2 ||20685524831999|| if anyone is running into edge cases
hm you can't brute force this can you
i don't think so yeah
well i can
i started my bruteforce and then got to working on optimal
finished optimal in about 15 mins and bruteforce was still running
it still is now actually, 25 mins in
if you unspoiler my part 2 answer you get an idea of how long a bruteforce would take
i'll keep letting mine run
I hate that it has no progress update and is probably very inefficient
hi @proper totem
imo it's easier than the optimal day 5
I think I kind of know optimal way of doing it
no
ok
thats illegal
ok I "improved" my code (I removed an unnecessary iteration) so now imma let those brute forces race
meanwhile ill try to do the smart way
got the setup
real
tyminky so smart
I was expecting my hypothesis to be completely wrong but worked 2nd try
i got it the smart way as well
but it makes sense
and my brute forces are still running
might leave them just because why not
I knew what I needed to do but my bren was too small to nicely figure out how to do it
Local variable node defined in an enclosing scope must be final or effectively finalJava(536871575)
die
now we need large input hehehehehehehheheheheheheheh
||pnpm add package-that-found-the-funny-number-for-me to the rescue
||
time to actually implement that myself because it should be simple and my brain is just too smol
||i googled the formula for it, but i should really find some sort of a math lib||
||mines ok tho i think https://github.com/aetheryx/aoc/blob/main/src/2023/day8/part2.ts#L33-#L35||
?
@daring marlin use spoilers please
ty admin
no one saw 
bro i misunderstood part 2
oh that is a pretty simple one
||its not the largest amount of steps until you reach a Z, its how many steps until all your ghosts are at Z||
so its gonna take an insane amount of time
idk why my brain was so cconfused it kept thinking it'd be so hard to do and everything I found on google just made me more confused
yeah bruteforce is not an option today i think
WAIT BUT IM SMART AF
guh this would be easy if i knew the lang

i dont use java often enough
1 trillion elephants, 1 trillion monkeys, etc
me when i didnt read part 2 instructions
||monkeys last year was LCM|| as well wasn't it
also was anyone else ||a bit annoyed that the demo input for pt 2 didn't work for with pt 1||
my solution: ||why recursive function, literally just calculate the steps to solution for every single start point individually and product them||
yeah
also annoyed that they used different ordering for example inputs and example solutions so that my program couldn't autofetch it
||i manually entered every possible A into part 1, entered the largest, it was wrong, i read the instructions again and went on https://www.calculatorsoup.com/calculators/math/lcm.php||
||I tried product of all, didn't work for mine, the number was absolutely huge and didn't even fit in non-lossy float territory||
||their least common multiple||
||online lcm calculator goes hard||
bro i couldve gotten leaderboard for part 2 so easily if i just read the task
yeah that's what i wrote, was replying to ty oops
at least im now #1 if u sort my global ranking
yeah same, and ||on paper, product of the counts would be correct (they would all end up at Zs) but the number would be too big||
it might be correct for some tho
||or bigint maybe||
i didnt even do it in code
I used u64s
me when
||Simultaneously start on every node that ends with A. How many steps does it take before you're only on nodes that end with Z?||
||so lowest is needed, but idk my solution worked||
shit so my part 2 implementation was correct but its not bruteforceable
||yeah product of counts works with bigints but i get 458644128295476585116655990797 vs 20685524831999||
I just thought about it conceptually after realizing how the "all at the same time thing worked"
i spent 50 minutes debugging a working part 2 instead of actually solving it
||let me try your input, see what I get||
yeah you put it above
@solemn python can i see your code
oh right
just a scooch
i found even the sample for part 1 stupid
I think the first sample for P1 worked to ||demonstrate that you could visit the same node multiple times||
i think it's just
something with this year's problems is off in general
it's them trying to fight against chatgpt/ai i swear
if it's the creators being concerned about LLMs or whatever it's kinda just making it all muddy for real people too
yeah
the real solution is to just get rid of the global leaderboard if you don't want people gamifying and cheating it like that
at least in my opinion
but I understand how disheartening the entire thing could be for him as well, this being a passion project and such
i'm like 90% sure the creator put all of the problem descriptions through chatgpt or some shit and made them more convoluted until chatgpt started being consistently wrong
yeahhh
ok I'm having a moment I just can't do tonight
yea id like to run all the test but i dont wanna make separate p1 and p2 tests
he released a statement on it
also lemme try something
yep
took 20 seconds
||20685524831999||
pushed to my repo
giv
silly bot
does it ignore it when you <>
note to self: if the puzzle instruction is to make the input loop (like the first line here) it probably means 1 trillion elephants
wait wtf we all had the same answer?
i had 17263
gpt solved part 2 in 15 seconds once i told it it cant bruteforce
ouh
bruh
so true bestie
blegh
i dont think today needs a better example input does it
honestly wording was fine
I understood the problem perfectly
yeah it's not really that it's not able to be understood
it's just,, kinda weird
doesn't feel like natrual wording at all, at least to me
well seeing as i was on pace for top 10 leaderboard i read it diagonally and thought i needed the first position where i at this point have reached every Z, not when im standing on every z at the same time
i thought by "they" he meant i could like visit a Z that im currently standing on as another ghost
or something
oh yeah the whole ghost thing is dumb
but it was just running part 1 six times and getting lcm
just say you have 6 camels bro
its kinda fun messing with the input
if I add a bunch of Ls my number goes up
if I add more it goes down a little
if I add some Rs it goes to 10112
pretty funny
"5 other elves come to help on their camels, what is the first point where you are all standing on a point that ends with z simoultaneously"
how random the result actually is
oh yeah notice how none of the zs are on the left
@solemn python giv url
guh
do
*replaces my path with 'L'*
*fans start spinning*
put on your reading glasses
never
the first 2 lines are just parsing
kill
ok i solved it with code
solve AOC using purely gates
wondering if anyone's solving using microchips
would be interesting giving the hardware limitations
solve AOC using marbles https://www.youtube.com/watch?v=i1e0T7lAELQ
I made a calculator with only marbles,
it's pretty bad
have a go yourself
https://code-bullet.github.io/MarbleCalculator/MarbleCalculator/
Twitter: https://twitter.com/code_bullet
Patreon: https://www.patreon.com/CodeBullet
Discord: https://discord.gg/UZDMYx5
maybe i was wrong
oops
nvm i was adding the lcm of all steps and latest steps to the lcm of all steps instead of setting it
what type int are you using
i64
what's lcm for ?
use unsigned 64 smh
nothing dont worry
oh
I've been having trouble concentrating
like In general
makes aoc harder for me
Tyminky
oh god part1 was extremely easy
I thought I needed to make pathfinding
it just tells you to follow instructions

java so bad
help I was curious so I looked on the megathread and got math theory jumpscared
wth is part2
Its so dumb I can't just do nodes[0] I have to do nodes.iterator().next()
instructions end with As to instructions end with Z
i agree
just have to find the total amount of steps to get every single XXA to an XXZ, stepping all inputs at the same time
oh okay
this is a genuine non-bruteforcable
unless you extremely optimize your loops
which is likely impossible to get it down to sane amounts
so if I understand right
I start at first line with the node
then iterate through instructions
and just going to the node as indicated by L or R
?
no bfs or anything?
20 trillion iterations
*quadrillion
14,631,604,759,649
and the 1 trillion elephants were actually rocks that took a few iterations to fall
so its more like 3-4 trillion rocks
so it would take about a day in rust
maybe i should do it
is 1 trillion elephants a past-aoc reference
yes
this is my first time doing it
you had to find the loop
and do math
which is why ive been calling today 1 trillion elephants
im not reading that
im happy for you or sorry that happened
I didn't do that one
im committing, I will not skip even one of these
yeah have fun with that
I could only dream of being on leaderboard
wait how do you not brute force
hmm
I'm too slow
@real hinge do you wanna see my crystal solution for day 5
you cant
just read carefully and see how to do it
also btw the input isn't random, its actually really nicely designed to work with a simpleish solution
is there a vscode plugin that can help me remember to push
to push to git?
idk
that was me
I bit your Internet cable
@real hinge what if you lost Internet access for like 10 years
rusher would forget about you
Die
it's almost time
Rusher wouldnt forget me
wrong
worm
he couldve made the first and last cycle length different from the usual cycle length so it would turn into 1 trillion elephants
worm backwards spells worm
you mrowed
Wth is mrowing
cat
Nop
@real hinge
Spam in vens dms
soon
notice how the path of ZZZ is the path of AAA but inverted
so true
I'm stealing this
okay
their gcd is prime btw
Math.
Math
||me watching everyone use lcm to calculate the answer while all I did was product it:||
hehe
You guys dont understand the release mode of rust
did u bruteforce it
doing
can you even multithread this though
i guess you can, store the indices of each starting position where it ends with z and check for full z's
thinking about how to make a large input generator for this one
I suppose you could choose a bunch of random numbers and then generate loops the go from **A to **Z with that number of iterations
how big are outputs btw
how many iterations do I need
my part B was ||22,289,513,667,691||
double digit trillions
yop
I will figure out another way later
yeah similar
bruteforcing aoc problems should be an exercise in parallellism/distributed systems classes
"how can you do this the best but in the wrong way"
id love it if we had that in our school
I was gonna use all my 6 cores
weve been doing c++ for 4 years and have done nothing useful
go do software engineering at a dutch applied sciences university, we've never touched a low level lang
imagine going to uni
were a technical highschool and this is the first year weve touched a high lvl lang
we did only c for 2 years
assuming a very generous like 500 ns per iteration it would still take over three and a half years to brute force on my input
someone was doing 100 million per second in rust
tbh I think most people here are not going unversity to learn programming
(at least me )
they said 36 hours
yop impossible
63 hours at 10ns
wdym impossible
i can let it run in the background
in 3 days ill make a reddit post saying i bruteforced it
my feeling when I got the conversion off by a factor of 1000
i might have to somehow do this using bitshifts
i think if you multithread it you could do it
i calculated the clock cycle speed of a 5 MHz cpu instead of 5 GHz
h
well actually
i had ||6|| starting nodes so multithreading won't even save you that much
I was so confused when eagely said the stuff about reddit but that makes sense now yeah
just up to ||6x||
the what
oh my brain mixed messages
the stuff about the rust guy with 10 ns iterations
and my brain mixed it with you saying you'd post stuff on reddit
if i get my c code to work i will bruteforce it and post when im done
as long as my estimated time will be less than a week
i would think it's safe to say that everyone had that many
insane
oh wait i deleted the parser
why did it not segfault
whats yalls part 2 output
i wanna use the input that has the lowest output
no way it works
by the way
for those of you who have done aoc for a while
obv the problems this year have been harder but i feel like i'm getting slower at the problems because i'm thinking more critically about them
was 10ns multithreaded
idk
after all of the fucking tech interviews and shit i've done in the past year and needing to "stop and explain my thoughts" i feel slower than i did last year bc i'm doing that habitually instead of just having an intuition and immediately writing code, having something working before even realising what i'm writing consciously
idk if that makes sense
it does make a bit of sense
you're stopping to kinda second-guess and confirm instead of just doing
yeah exactly
like, even during parsing
today i realised that for this entire year of aoc, in every step of the parser, i log the input and run my code and validate that i'm doing it correctly so far
so the raw lines, after seperating by =, after parsing them as numbers, etc
and i asked myself why tf i was doing that
and it's like
this sort of stuff is good to do when you're working on actual stuff
i only built this habit recently
i didn't expect it to carry over to aoc unconsciously
I feel like I've sorta gone in the opposite direction
I used to not have any confidence in what I write and this is the first aoc I've written a substantial portion of the solution (or what I think the solution is) before running and logging anything
though that's looking at a history of several years, going back to 2020 probably
interestingly 2020 is the year I got furthest in AOC
and it has declined since then (though I plan to try to do the whole month this month we will see how far I get)
while (!allNodesEndWithZ) {
allNodesEndWithZ = true;
for (int i = 0; i < currentNodesCount; i++) {
Node* node = currentNodes[i];
Node* nextNode = (step % 2 == 0) ? findNode(node->left) : findNode(node->right);
currentNodes[i] = nextNode;
if (!endsWithZ(nextNode->id)) {
allNodesEndWithZ = false;
}
}
step++;
}
how can i optimize this
no strcpy
a what
do i just reset steps every time it reaches length
I probably misunderstood something
are you not using the L/R from the input
or are you just alternating every other for fun/to not have to parse that
alright well that would work then
well it works but i want it hyper optimized
a potentially faster way would be to have a boolean that you set and inverse but I'm not sure how modulo compares in speed to a bitwise not + cmp + jump if equal combined
how fast is strcmp
unless you can narrow a usecase that is a subset of what strcmp does, the c std library is likely already the fastest something can be done (and something that your compiler can optimize the best)
are you using it to find nodes in your tree?
I think you could make a relatively trivial "hashing" algorithm to make finding a node O(n) and essentially just accessing an array (no clue if this would be worth it at all)
going to see if it would actually fit in memory or not
i stopped using modulo and it started infinite looping
yea
Node* findNode(char *id) {
for (int i = 0; i < nodeCount; i++) {
if (strcmp(nodeMap[i].id, id) == 0) {
return &nodeMap[i];
}
}
return NULL;
}
okay well
the easy way to make this faster is build your tree beforehand so you only do each strcmp once
something like
struct Node
char[3] id;
Node* left;
Node* right;
}
``` instead of having left and right being the node ids
that would remove a significant number of string comparisons, you would be doing on every single iteration
and you'd essentially just be following pointers then which is much faster
you'd still need your findNode method to build the initial tree though ofc
im already doing that
typedef struct {
char id[MAX_NODE_NAME_LENGTH];
char left[MAX_NODE_NAME_LENGTH];
char right[MAX_NODE_NAME_LENGTH];
} Node;
oh wait
u mean ids
true
wait then i dont need any ids at all do i
i just add a boolean isZ
that would work too yes
but checking id[2] == 'Z' would take the same amount of time as if (isZ) so you might as well keep the IDs to help you debug
ok
they won't add any overhead when doing the iterations since you shouldn't be doing any heap memory changes at that point
reading trees from files in C is fun
i will be excited once you get to nullptr and segfault land (if you did end up implementing trees with pointers instead of strings)
i have already had many segfaults in this code
ok theyre just saying dont optimize code before finishing writing it and the compiler exists and it optimizes for you
thats cool and all but i dont think the compiler optimizes the fact that im iterating through the entire input every time i wanna go left or right
it does not
that's why i suggested using pointers and not strings for left and right
I dont know what I am doing
just point directly to the left or right node
but it worked out
no array access needed (Aside from building the initial node tree)
||guh I think whole thing in part2 was they are going back to their initial state after XXZ, but game doesnt tell that ||
||if it didnt do that I wonder if there was way to not brute force||
nnop I can not be scared
btw how did u guys do part 2
exactly how everyone else did it
||I got gcd of all numbers which resulted with 269, divided all numbers to 269, multiplied them and also multiplied with 269||
||find how many times for each to land on the first X and the find LCM of those||
get the first time it reaches z and lcm them
mine was 263
which is ALSO prime
i think i might pull a betaveros
and write my own language
so i have an op parser
and itd be faster than kotlin cuz itd be written in rust
did you give up on c
oo makes sense
I was gonna say that's quite a jump from c to making your own language xP
so im using it to bruteforce
that would be a project for 2024
and https://codingcontest.org april 2024
if i do it ill call it yesulith
he basically did what i want to do
every operator is infix
parsing is extremely easy
bro but imagine
print sumindex input lines contains >12 red >13 green >14 blue
print sum input lines max red * max green * max blue
that being all the code for day 2
day 4 smth like
print sum input lines :wins | :my 1 << wins & my - 1
n := input :lines :wins | :my 1 << wins & my - 1`
c := list 1
print sum c c@line>.line+index + c@line index line for enum lines
this syntax has so much sugar im gonna get diabetes
day 1
print sum input lines first digit append last digit
print sum input lines first digit | in :nums "one two three four five six seven eight nine" append last digit | in :nums
day 3
print sum input lines grid remove number & regex [^0-9.] not in neighbors filter digit
print sum input lines grid remove number & * not in neighbors & neighbors map number size != 2 filter digit
and after syntax is implemented, all of those functions like grid neighbors filter map digit regex size wont be difficult to implement because ive already implemented all of them in kotlin and know how they work
wait actually
it should be smth like
submit verify sum input lines max red * max green * max blue
and then it opens a popup with the answer
im cooking here
how is it today @real hinge
part 1 good
is it fun or bad to you
1 was fun
u love
cant say same thing for part 2
you cant brute force part2 unless you have nasa computer
or 50 hours to kill
yop
I thought part1 was djakstra pathfinding for a second 
then didnt look for some time
then realized its so simple
part 2 was so fun π
i hope there will be a puzzle today where #1 global is over an hour
that would be super fun
we had a few with 20mins last year
1 where #2 was 40 mins
this is why c is op
sscanf(line, "%s = (%s, %s)", id, leftId, rightId);
u dont even need to parse
u can just do that
bro this is insane wtf
@tranquil vapor gemini scares me
what's gemini m
i think this is the best function ive ever written
i have decided that id rather implement scanf perfectly in kotlin than bruteforce day 8
HAHAHAHA
God so fire
Making a large input will be fun
@tranquil vapor aoc
@real hinge Advent of code
do
blame google
it cannot images
yeah it told me duke was elon musk 5 minutes ago
I object
@tranquil vapor do aoc
cannot
Introducing Gemini β Googleβs newest and most capable AI model.
Watch as Google DeepMind Research Engineer Gabriela Surita demonstrates Geminiβs advanced coding abilities, including quickly prototyping a web app to explore Londonβs train stations.
Research Scientist RΓ©mi Leblond also introduces AlphaCode 2, an advanced code generation system ...
I wonder if it can even do aoc
past day 5
he will take my job soon
yop
its been 12 hours and theres still no app restoring the old ui
the alphacode 2 one def can
gpt 4 has been able to solve every day so far with 1 sentence of assistance (the brute force takes too long for example)
first days are yeah
but what about others
also if gpt4 can solve it doesnt that mean they made it harder for no reason 
what
first day dont even require assistance for it to solve
do u rly think he solved day 8 in 38 seconds manually
huskk
38 seconds is really impossible
reading takes about 5 seconds to part 1 if youre fast, parsing takes 5 seconds if you use my scanf function, you now have 51 seconds to implement a fake bfs
also he could be using a custom lang
LMAO
12 SECONDS
wait 12 seconds is even much for ai
gpt4 would take more than 12 seconds to respond
unless you gave it full input and question
maybe bro did
instr := lines first
nodes := lines map scanf("%s = (%s, %s)")
cur := AAA
steps := 0
infloop cur = nodes[cur] apply instr[i] steps ++ break if cur == "ZZZ"
ok nah he used ai that took like 2 minutes even in a fake lang
custom language peopel are insane
imagine inventing a custom language so you can parse and solve aoc problems
this is basically https://github.com/betaveros/noulith
do
this
for (x <- 1 to 100) print([[3, 'Fizz'], [5, 'Buzz']] map (\(f, s) -> if (x % f == 0) s else "") join "" or x)
maybe he has some tool that isnt even a language
you can vim multicursor to select the nodes
those are nodes
that have left and right values
and at the top you have instructions
???? 35 s
start at AAA iterate through first line repeating go to corresponding nodes end at ZZZ
repeat those instructions until you go from AAA to ZZZ
for day 1 thats not surprising
last years was done in 29s with video evidence
part 2 isnt
actually it is if you know how to read
(i dont)
im not yapping im ventilating
Placed 49th on part 1; 28th on part 2.
Problem: https://adventofcode.com/2022/day/1
Code: https://github.com/jonathanpaulson/AdventOfCode/blob/master/2022/1.py
man looks at problem
writes the code 2 seconds later
really insane
2022 part 1 was hella easy bu t
JUST UNDERSTANDING PROBLEM IN 2 SECONDS
is insane enough
look at example, ok split \n\n
the word most is highlighted
the question is how many calories is that elf carrying
makes sense
I know there are some patterns
when they look at example input and answer
those poeple kinda see the solution immediatly
gpt 4 takes 15 seconds to solve day 1
if you are copying the puzzle page, and then request it in gpt 4 via api
so it would start solving the moment the puzzle opens
3.5 solves it in 2 seconds but outputs wrong answer
so it doesnt solve 
I am thinking instead of asking it to generate code
ask it to generate answer
if that dumb as hell ai can do calculations
it would be way faster
part2 is NOT easy
do NOT try to brute force

you cant
you can
someone calculated even with 100 Million iterations per second it would take 50 hours
i tried to do it in c
calculated it would take 63 hours
then gave up because c is hard
how many million per second
idk i couldnt parse the nodes efficiently (so i dont have to do any array lookups when solving)
its not complex its just 1 trillion elephants v2
but the solution is easier
@tranquil vapor DO AOC
See the issue is elementary was too long ago
I actively got worse at basic math while taking calc last year
i will do instead later today maybe
@native pewter
https://old.reddit.com/r/adventofcode/comments/18cr4xr/2023_day_7_better_example_input_not_a_spoiler/
yes it is
the input is designed to be lcm
I know of someone who is angy that today was "rigged" (their own word) to work with LCM because they put in a bunch more work to use chinese remainder theorem (which i know nothing about) and missed the leaderboard
which feels like a silly thing to call rigged
im also angy because it wasnt brutefroceable and i lost p2 lb because it wasnt
#5 of p2 lb made a video while solving it, the moment he looks at it he goes "ah yes, this is an lcm problem"
you already had m and n so crt isnt that hard to implement is it
you already had the number of steps to reach z for the first time and the number of steps that the loop has so you couldve just done chinese remainder
Oh huh yeah that is a smart way of brute forcing it
It's just faster bc you don't do the checking every loop, just don't math
Interesting
thanks that actually helped i think
It's kinda funny cus the first thing I thought of was to graph the input
Cus I knew it would have something interesting

nice
love
we should psychologically prepare for day 9
I am telling you guys
tomorrow is djakstra algorithm day
not good stuff are waiting us
i am preparing by writing the best parser possible
NOOOOOOOOOO
i'm legitimately dreading any of the pathfinding problems
dont worry its just my theory
i'm gonna guess day 11
I actually have no idea what will be tomorrows problem
for pathfinding
this year was pretty hard
also tomorrow is odd day and weekend
it will be tough prob
this year sucks balls
hop on 2015 day 7
*wasnt
isnt that just a bunch of switch cases
meh=
wait why did p1 take 1 hour to cap
u just make a map of all registers and a switch case for the operations

jus brute force it cant go wrong
put on server shrimply
HUISK
messy c bruteforce cc @hazy sinew
Spawning threads for part 2 is genuinely easier than not
guh actual nodes?
?
eh ig nvm
Are u doing today too
what...
no from foxy
Oh true true
i did already, wasnt too hard
Uiua moment
It's just easier to capture the arguments that way
Cus arguments aren't real
Only the stack is real
whats the point of using a linkedlist over a plain array
there isnt any correlation between the nodes
there is
well
it's not exactly a linked list
it's a graph of interlaced circular linked lists
zusammenhΓ€ngender graph :3
the advantage of this is that you don't need to do array lookups or filters to find the next node, you just jump to it using node->left or node->right
but array lookups are just ptr + i
but you have to find i
its the same complexity?
arguably better on cpu caches
linked lists are rarely useful unless you're avoiding reallocations
That means you'd have to first convert the node IDs into numbers
Which isn't too bad it's base26
I thought about doing that too
But ideally better to like
just id[0]*3 + id[1] * 2 + id[2]
Not parse as base 26
Uh you'd have to do it like
Powers of 26
You'd be better off memory wise just numbering them in a sweep
Then another pass to number their links
Well
BLEH
then you're just making a linked graph like I am with indexes instead of pointers
and
same time complexity
Not the same locality
fp ass C code
But locality is fake with these inputs anyways
the locality depends how you're storing things in the first place though
all my nodes are still in an array together
so the advantage is its saner to buidl
just use a hashmap 
hash map so slow
ram is a hashmap of numbers to arbitrary objects
wdym, its O(1) 
wtf kinda hashmap
what
worst case is O(n)
bleh?
that is if everything collides though apparnetly
i mean yeah if your hash algorithm is complete garbage for your usecase
good vid
https://youtu.be/DMQ_HcNSOAI
I had a week of fun designing and optimizing a perfect hash table. In this video, I take you through the journey of making a hash table 10 times faster and share performance tips along the way.
00:00 why are hash tables important?
00:31 how hash tables work
02:40 a naΓ―ve hash table
04:35 custom hash function
08:52 perfect hash tables
12:03 my p...
i watched that before you were born
no..
litrly
In having a hard time writing ||LCM|| in Uiua π
||shrimply use the lcm glyph||
u will brute force

HOW THAT DOESNT EVEN MAKE SEN
wdym
same
|| basically just start at x and keep adding x until all other numbers divide xd ||
THIS UNPUT IS STUPDI
crystal is so good bro omg
||
nodes_steps.reduce(1_i64) { |acc, curr| acc.lcm curr }
||
idek whats going on oofie!
WHO DDOSED CODEBERG
git federation will exist NOW
the fact that it even has that in its stdlib
insane
crystal is the best
ITS YOU
@warped dust @warped dust @warped dust @warped dust @warped dust
||what's funny is the input is specifically made so that the gcd of the path lengths is the length of ur instructions||
oh waht the fuck
/run ```cr
puts 69.lcm 420
Here is your cr(0.36.1) output @tranquil vapor
9660
its literally ruby
So u just need to ||prod(paths)/len(instructions)||
/run ```rb
puts 69.lcm 420
Here is your rb(3.0.1) output @warped dust
9660
rini
so real
also gcd
rininininiininini
/run ```rb
puts 69.gcd 420
Here is your rb(3.0.1) output @tranquil vapor
3
fake
@hazy sinew
U love
crystals kinda insane
you're insane
???????Γ
dum as hell
||it's more like the inputs are crafted so that the start points and end points map to the same points, and that's just an emergent property||
yop
if they weren't, you wouldn't be able to lcm
thats why i even used my brute force solution
cause i didnt realise
ForgeFed will be completed NOW 
Last I checked there was
A Personβ’ working on federated stars in forgejo which ig is some progress
But I think they are mostly focused on f3 rn, less ForgeFed

/run
Here is your ts(5.0.3) output @proper totem
23147 22289513667691
i will use bot to solve aoc from now on
yop
