#advent-of-code

1 messages ยท Page 52 of 1

humble copper
#

close to burning out, really hope the next day is easy

north silo
#

I didn't actually intend to stay up for this, but here I am ๐Ÿ‘€

humble copper
#

(its still today for me bc it unlocks 9 pm)

woven sable
#

I think Eric should be aware though that tomorrow is Christmas Eve and so hopefully it's easy

humble copper
#

ive heard he makes it easy for christmas day

#

i hope that also applies to christmas eve

#

watching the aoc conference that eric did in 2019

#

the crowd is just dead silent the whole time

#

(not literally, but still)

woven sable
#

~30 seconds left

woven oriole
#

.aoc c

hidden copperBOT
#

Day 24 starts <t:1640322000:R>.

woven sable
#

10 seconds left!

hidden copperBOT
woven oriole
#

oops

lost dock
#

NICE

crystal shard
woven sable
#

OH MY

#

today is amazing

#

I love it

foggy zealot
#

sixth

crystal shard
languid stratus
#

I feel like once again, my lack of understanding of the question in the first place might be my downfall here

#

I should probably turn my screenreader on but I'm not sure it'll like all of the numbers etc.

crystal shard
#

wow 8 mins

humble copper
#

ERIC

#

THANK YOU

devout tusk
#

i don't even understand how I will even approach today's question ๐Ÿ’€

woven oriole
#

seems like no one understood the ques lol

devout tusk
#

p2 is defo going to have jumps

woven oriole
#

bruh where is the number

#

it is only initializing variables

#

and doing operation

devout tusk
woven oriole
#

its value is 0 right

#

hm

woven sable
#

alright I think my sol is odne maybe

#

it's just real slow

#

:P

devout tusk
humble copper
woven oriole
#

The ALU is a four-dimensional processing unit: it has integer variables w, x, y, and z. These variables all start with the value 0

woven sable
#

someone finished both parts already, damn

devout tusk
woven sable
#

anyone else use ||match|| & ||case|| forthis?

humble copper
sonic silo
#

||im in 3.10 but i dont wanna use match case||

humble copper
#

extra tempted to ||just use a dict to store the values of everything||

#

perhaps ||the forbidden eval()|| will make a reappearance today?

languid stratus
#

I have a working code but I have done some calculations and it will take roughly 3.17 years for it to run fully

humble copper
#

well this is.... ||a bit large....||

humble copper
#

for this, can we assume that ||all values below the maximum are valid and all above are invalid|| or ||are the valid values scattered throughout the possible values||?

crystal shard
humble copper
#

||9^14, 9 possible values per character, 14 characters required||

prisma sundial
#

๐Ÿ™‚

humble copper
#

nice

#

||so part 2 is easy?||

prisma sundial
#

part 2 is min instead of max

#

so yes

pearl moon
#

So the crux of this is to look at the || instructions that follow each input and figure out the valid input range for that digit|| right?

humble copper
#

lmao

#

what

#

haha thanks eric

#

you're a lifesaver

humble copper
# prisma sundial

||are the valid values scattered or are they constant up to a certain point||

prisma sundial
#

i have no clue

pearl moon
#

Could a runtime for the solution be || 14 * 9 aka O(n) in the number of digits of the model number ||

humble copper
pearl moon
#

Sure, so you have to || manage that carryover as well ||

humble copper
#

so ||for setting x to x + input you'd have to also take into account what x was before an input||

#

i was thinking ||find z as an expression of inputs a-n||

#

then ||pray that eric made the valid numbers constant and not scattered ||

#

i'll do this tomorrow, but im really glad it's this easy

earnest forge
#

I literally just wasted a minute by typoing 14 to 24 -_-

earnest forge
lapis beacon
#

.aoc unsubscribe

hidden copperBOT
#

Okay! You have been unsubscribed from notifications about new Advent of Code tasks.

mossy stream
#

finally a fun and quick puzzle

#

part 2 better be nice

daring monolith
#

.aoc unsubscribe

hidden copperBOT
#

Okay! You have been unsubscribed from notifications about new Advent of Code tasks.

dense herald
#

For day 20, part 1, I get the same output for the example after the two image enhancements, but an incorrect result on the real input. Some of my assumptions are that the image expands by 1 pixel on every side with each enhancement and that every new pixel value is determined before any existing pixels are altered. Is this right?

restive imp
proud cosmos
#

time to figure out something smart

ruby epoch
#

For AoC day 5, I'm handling those coordinates by checking if either side are equal and if so, taking the other side and using them as a range to append to a Counter, basically doing for i in range(y.1, y.2+1) when x is equal

However, when I hit the line 2,2 -> 2,1 from the test data, I'm basically doing for i in range(2, 1+1), which is clearly an issue, so I'm trying to work out a better way to handle this. Has anyone got any ideas? (The screenshot shows the portion of code I'm looking at)

woven solar
#

You can just swap the two if they are in the wrong order.

#

e.g. a,b = min(a,b), max(a,b)

ruby epoch
#

That sounds like it'll work. I never think of those

proud cosmos
#

Turns out to be more work than I thought to get a smartish solution

muted aurora
#

Haven't looked at today's thing yet, how is it in terms of difficulty?

#

Compared to the last few

frigid mural
#

naive solution is trivial, its just an optimisation problem

muted aurora
#

So like most other days then

#

Cool, thanks

proud cosmos
#

Hmm

#

Still not sure how to optimize it

#

seemed easy but maybe it's not that easy?

#

Maybe i'm jst dumb and doing useless stuff

#

Lol

mossy stream
#

... there is no example for today, is there

proud cosmos
#

There are a few

#

just no working value

#

Hmm

#

Honestly copnsidering just doing it on paper

#

seems easier than trying to find an algorithm at this point

mossy stream
#

I think I underestimated the time needed to bruteforce

#

I don't want to do constraint solving

frigid mural
#

||imo the main idea for optimising is the fact that whatever an input digit is, its not equal to a variable if its 10+, which leads to a lot of cases where a digit is free to be whatever||

proud cosmos
#

I feel like I saw that but I am still not sure how to actually use that information to do anything

#

I guess one more thing to reduce

frigid mural
#

and thats why im going line by line with pen and paper ๐ŸŽ‰

proud cosmos
#

yea almost feel like that's easier

#

than doing it with an algorithm

#

just get a z = at the end or smth

frigid mural
#

||trust me there's a TON of useless operations||

proud cosmos
#

lol

#

Yeah

#

||I looked at the start and the first few are already useless||

#

Lol

frigid mural
#

||im 45 lines in and there has been a net of 1 useful operation||

#

||all the other 'useful' ops are literally part of something that resolves to 1 for whatever input digit so no need to even calculate em each time||

proud cosmos
#

I wanted to make somethign that goes through and figures this out but it didn't work out so well

#

maybe its no-code time

frigid mural
#

Oh wait big brain idea

proud cosmos
#

nice

#

lets hope it works out ebtter than my ideas

#

they haven't so far

frigid mural
#

||We could instead go through sections at a time, say between y=0 resets, and run through the possible digit inputs, link them to the output variables. If the output dict is constant then we know the value of the digit doesn't matter so we lock that in at 9 and move on||

old sentinel
#

hey

#

so

frigid mural
#

||Would still have to manually go through the actually meaningful digits if we want more optimisation but still||

#

|| oh duh the splits we wanna use are just the input lines, so that even if the w variable changes then we ignore it anyway as it's about to be overwritten||

proud cosmos
#

Maybe I was just doing it dumb though

#

I think I tried something different with those that makes less sense

#

tbh

frigid mural
#

||I'm sure there are still exceptions and you'd have to take a look at them, in fact there necessarily must be orher wise 999999...999 would be valid||

#

But cute down a lot of the work

proud cosmos
#

It's possible it may cut down the work yea

frigid mural
#

||Even a single deduction divides the search space by 10 so whilst we may not get them all we still have a good shot, and can perhaps manually finish it or run exhaustive search||

proud cosmos
#

I've started loving asserts tho

#

more asserts more better

#

I've also noticed that || each of the sectors has barely any difference, 1-3 commands wonder if that is useful to know||

uncut wave
frigid mural
proud cosmos
#

Nice!

#

I'm back in action lets try this again

primal vapor
#

are your end z very big too ?

#

I have things like 196685829

proud cosmos
#

Yea

#

Still trying to figure out how to limit anything

#

except no-code

#

which sounds easier at this point

#

Though I should be able to do what I do with no code in code as well right

primal vapor
#

yes

#

it's frustrating

proud cosmos
#

Seems hard somehow idk

#

maybe I just need to start blank

frigid mural
#

||if you cut the code into blocks you can abuse the repetition of patterns in there to reduce the computation required for each step||

primal vapor
frigid mural
#

not yet but i can see how itll work, as there's ||a lot of cancellation, for example only the prev. value of z is relevant in each block||

primal vapor
#

yes I saw that

proud cosmos
#

Yea

#

I'm thinking if you can solve each block based on requirements

#

That should technically work sounds pretty hard tho

frigid mural
#

||could go backwards block by block too ig once you know the relations||

proud cosmos
#

||Like if you do the math you can find out that the last block either requires z to be 0 or z%26 to be equal to w, you could solve the other blocks trying to get either of that||

frigid mural
#

exactly

proud cosmos
#

Just not sure how you'd get that with code

#

Lol

#

Does not sound trivial

primal vapor
#

yup

frigid mural
#

||looks like it probably wont ever be 0, so you can probably get away with using mod26 throughout||

proud cosmos
#

Persumably

primal vapor
#

I just got an idea

#

reading a reddit post

#

||"The number of possible states the ALU can reach at a given line is significantly smaller than the possible number of input read "||

#

so maybe

proud cosmos
#

Idk ||I tried going that route and the first sector literally just sets z to w+7||

#

||Which would make the states = to the inputs||

#

Maybe it gets betters

primal vapor
#

||we can build a dictionary with key (z,w,current_digit_index) and value true if final z is 0 and false if it's not||

#

so that we don't calculate 2 times the same thing

proud cosmos
#

basically what I wanted to do but it seems to still have a ton of possibilities so yeah idk

gusty basalt
#

hey guys my input code is correct but vs code is not lettin' me enter the input how to resolve this error

#
a = input("Enter your age\n")
if(a>=18):
    print("Yes,your age is greater than 18")
else:
    print("No,your age is less than 18")
#

someone pls help me out

proud cosmos
#

rofl if this pattern repeats the entire time I am pretty sure i know what to do to calculate it faster

#

no-code op ig

north silo
#

Yeah I have no idea what I'm doing today blobpain

proud cosmos
#

Stare at it for a long time and then continue being confused

#

smth like that

#

Feels not that hard though

proud cosmos
#

Hardcode never hurt anybody

livid gull
proud cosmos
#

And myself a bit

#

but yea

#

seems easiest way to get that stuff

sleek cave
proud cosmos
#

Scientist only know 3 planes of existences so far

normal plane

banana smoothie plane

aoc day18+ plane

#

We are still trying to get into the smoothie plane

maiden brook
#

I thought day 19 was supposed to be the peak pithink

proud cosmos
#

Apparently not

#

Though it honestly does not feel that hard today

#

you can technically solve it trivially not sure if it'd finish today tho

livid gull
#

depends what youre better at, certain problems can be harder for certain people

sleek cave
#

same. then came d21p2, then d22, then d23...

proud cosmos
#

Just rent a few servers..

#

:)

sleek cave
proud cosmos
#

Unless you have a lot of RAM/Space tho..

#

also you can't really parallize that well

#

today would be trivial

#

Lol

woven oriole
#

tomorrow should be ok

proud cosmos
#

Could easily split it into 100 servers and search all of them

primal vapor
#

ok aurora

#

remember the dic thing ?

proud cosmos
#

Hm?

primal vapor
#

forget it

proud cosmos
#

Yea?

#

Lol

sleek cave
#

pure bruh moment

proud cosmos
#

rip

#

I got something else now

#

a magic formula

#

|| for any step: z=z//v1*(25*(z%26+v2 != w)+1)+(w+v3)*(z%26+v2 != w)||

#

I believe.

primal vapor
#

itering throught all possibilities is too long even if you just loop without doing anything

proud cosmos
#

There are quite a few

#

||9**14||

primal vapor
#

yup

#

so even if you have a magic formula

#

for each step

proud cosmos
#

Hmm

primal vapor
#

it'll be too long

proud cosmos
#

It must have to do withthat though

#

and reducing possibilities

primal vapor
#

I think we're not supposed to code x)

proud cosmos
#

You can definitely do it with code

#

but yeah it kinda feels like it'd be easier without at this point

wooden jewel
#

I am unironically just gonna feed this to ||cplex||

#

me ๐Ÿ‘‡๐Ÿป

proud cosmos
#

Lol

#

Nice

#

haha

#

Beep boop

#

I'm the computer now

#

PRob gonna fail horrilby after like 2 or 3 though

candid sigil
#

So day 24 can't reasonably be brute-forced? Scanning the input, I couldn't see any obvious optimizations beyond ||ignoring instructions to divide or multiply by 1||.

proud cosmos
#

We managed to get it down to like a single formula for the value we care about + a few random digits

#

but even then taht's too much

#

Even calculating one formula a few quadrillion times would take forever

humble copper
proud cosmos
#

Yeah there are a few things you can do to reduce it

humble copper
#

or if any ||adds by zero, skip||

proud cosmos
#

ah yes it'll be done soon

candid sigil
# wooden jewel

My ||poorly implemented Dikjstra|| for day 15 took 10 or 15 minutes, which was the longest one for me so far.

wooden jewel
#

I left my day23 part 2 run over night (||A* with quite a few optimisations||)

#

Guess what

#

no result

proud cosmos
#

f

wooden jewel
#

Took 32 gigs of ram in the morning

#

I was ready to punch a mf

proud cosmos
#

Huh

#

My p2 takes like almost no time you prob had some mistake in it

wooden jewel
#

๐Ÿคทโ€โ™€๏ธ

candid sigil
# proud cosmos Huh

I heard on the subreddit that ||some inputs are a lot easier to solve than others, to the point that one poster had one that was easy to hand-solve||.

wooden jewel
#

@proud cosmos could I try your input?

proud cosmos
#

sure

#

mine must be incredibly easy

wooden jewel
#

Just wondering

proud cosmos
#

||#############
#...........#
###A#C#B#D###
#B#A#D#C#
#########||

#

rip formating

#

But yeah my part2 is incredibly fast with that input

#

It's like 10x fater than part1

north silo
#

Oh ||I took a closer look at my input and the sequence of operations is periodic, so I think I can take a crack at this||.

#

Also ||some of the constants in the input seem to be hinting at something...||

proud cosmos
#

HUh?

woven sable
wooden jewel
#

wdym?

#

It keeps finding new better results, just never actually finishes

woven sable
#

Oh

proud cosmos
#

It should finish relatively quickly tho it prob goes through some invalid states or smth?

#

Did you see if the example works with the numbers

#

Maybe assert every step of the example

#

More asserts more better

#

Well my hand method worked for about 1/4 of the input

#

now it;s just too big

#

:)

frigid mural
proud cosmos
#

I mena it does kinda have to do smth with it

#

but not really either

north silo
frigid mural
#

||just if the constant 26 reminds you of the alphabet, its arbitrary and sadly you dont get any nice word outputs||

proud cosmos
#

hmm

#

I feel quite lost now

#

maybe I should just let a brute force attempt run anyway

#

Lol.

frigid mural
#

||the final solution is gonna be brute force at least for me, but you can massively reduce the search space||

#

||when you reduce the search to 7 digits only you can still do it at a decent speed especially when you know how the blocks work and make that process faster||

proud cosmos
#

Okay I efel like I kinda get what to do now

#

but I still don't really get how to do it

humble copper
#

i dont

#

i tried creating a magic equation for z

#

that i could ||run through eval||

#

turns out that its too long

#

and causes a stack overflow

proud cosmos
#

rip

humble copper
#

so i dont know what to do at this point

proud cosmos
#

go ||through the stuff and find a pattern||

candid sigil
#

It does seem ||the sequence of instructions is the same for each block, with only the values differing. So you could maybe write a function with the instructions and partialize it with the values for each block||.

humble copper
#

yep i see it

#

looking at the input

proud cosmos
#

Yeah and then need to continue somehow from there

#

^me

#

anyway

woven sable
#

Or, ||you could use backtracking if you wanted to.||

proud cosmos
#

I feel like I know what my very last number should be

#

rofl

#

so that's cool (?)

#

I think anyway

#

Like i'm quite certain that it must be that number or else it wouldn't work

#

I could backtrack no-code from here ig

humble copper
#

so for me ||the values on lines 5, 6 and 16 for each segment of inputs differs||

proud cosmos
#

for me ||[5, 6, 16]||

humble copper
#

wait yeah thats it for me

mossy stream
#

you should have three lines that changes

proud cosmos
#

Okay I can pretty much guarantee that || z <= 5109711748 for all steps||

#

I can prob press that upper boudn down

#

might be useful

proud cosmos
#

||I made a magic formula and checkd what the "impossible best case" would be roughly||

#

should be way too high though and not acutally doable

#

Weird wonder why

#

I mean that's normal though

ruby epoch
#

Any chance I could have some help with part 2 of day 5? I'm finding that this is passing the tests, but when I run it with my actual input, it's lagging out/hanging. I think the issue is with lines 31-36 here (or the whole of the while loop at line 28) but I'm not sure how to go about changing/making it work properly. Any suggestions/advice would be greatly appreciated. https://paste.pythondiscord.com/ulofonanac.apache

#

Really? I've had whole discussions about previous days here before

final silo
#

Im gonna guess that people are busy those two days usually.

ruby epoch
#

Also where do I go if I don't want spoilers for today?

#

that... defeats the purpose of a spoiler channel

proud cosmos
#

I feel like it should be fine here, maybe spoiler the link

#

Though I am not sure how much help you will get most people sit in spoilers when they are done

woven sable
#

Tbf yesterday was quite hard

ruby epoch
#

I'm asking for help on something from 3 weeks ago without seeing the stuff that's happened sinc ethen?

proud cosmos
#

this time surely it's easy

#

right?

maiden brook
#

we have to complete day 25

#

otherwise christmas won't be happening

#

one person* needs to complete day 25?

proud cosmos
#

yes

maiden brook
candid sigil
#

I believe day 25 is traditionally easy, because not many people want a hard puzzle on Christmas day, but you never know. Last year it was very easy.

analog shadow
#

what's advent of code

woven sable
#

also you have the exact same pfp as @hidden musk lmao

hidden musk
#

wonder where he got it from

#

I added the hat, to my screenshot

woven sable
#

Probably from you then

hidden musk
#

although the character is not mine

analog shadow
hidden musk
#

ยฏ_(ใƒ„)_/ยฏ, kinda weird though

analog shadow
#

lol

#

also what character is it

#

@hidden musk

hidden musk
#

hayan from unholy blood

frigid mural
placid lake
#

i have not had time to do the past two days

#

sad

woven sable
#

A lot of people did it by hand

placid lake
#

yeah, i looked over it

#

seems.. interesting

#

kinda reminds me of the towers of hanoi problem

woven sable
placid lake
#

anywayy, happy holidays to all of you

#

iโ€™m off for now

proud cosmos
#

Happy hollidays!

shadow stag
#

Only 12h 30m left until the last set of problems are released

maiden brook
#

12h 30m left until we find out what happened to the keys

proud cosmos
#

nvm you've left them at home unlucky

candid berry
humble copper
#

out of curiosity ||i tried to find the entire equation for z given a whole number. i cant even read the whole thing||

#

||the whole file is just text with the equation||

livid gull
humble copper
#

yeah i did

#

but i just wanted to see ||the whole unsimplified equation in all its glory||

ruby epoch
frigid mural
#

ez solve

humble copper
#

||maybe symbolab or wra||

frigid mural
humble copper
#

||wait can desmos do substrings||

frigid mural
#

||no need, just use modulo to separate the digits||

humble copper
#

ok theres just one problem with that

#

||i cant copy the whole equation because its so big||

frigid mural
#

||the other problem being that theres no way desmos will ever be able to rnder that||

sleek cave
#

taking a break from aoc today ๐Ÿ˜„ gonna finally start learning numpy

#

i'm already in love

humble copper
livid gull
#

used it for only the cubes i think

candid sigil
sleek cave
#

and i'm not even done reading the introduction yet lmfao ๐Ÿคฃ

sleek cave
#

i'm going to re-do some early aoc puzzles using numpy when i learn it

humble copper
#

wait

#

question

#

we've been in a submarine for almost 25 days

#

in terms of food

#

...what happened to all those fish we met along the way?

#

||joke dont get mad at me ik its a stupid question||

sleek cave
proud cosmos
#

They multiply too fast anyway

robust heart
#

Merry Christmas everyone!

#

Still at 28 stars haha

#

I wanted to give a shot to the other days but Iโ€™ll think Iโ€™ll take a break for now

#

A short one though

robust heart
humble copper
#

woah i just did 2016d6 in 10 minutes

#

thats insane for me

sleek cave
#

ggs!

robust heart
sleek cave
#

usually d4 - 9 takes me 2 - 3 hours lmao

#

then d12+ takes 3+

humble copper
#

i was watching the advent of code conference and eric said that a college used 2016d6 as the midterm for a computing course

sleek cave
#

then d18+ is hell

humble copper
#

so i decided to do it for no reason

#

and finished in 10 minutes'

#

less actually

robust heart
#

I stop at day 10 usually

humble copper
#

i think it was like 5

#

i wasnt timing

robust heart
#

Also I noticed the personal ranking lol

#

Got no points because I took 18 hours to several days lol

#

This is what happens when Iโ€™m distracted

muted aurora
sleek cave
#

2016d6p1 is just 2021d3p1 but easier lmao

#

almost no difference

sonic silo
humble copper
#

eric said the final was 2018 days 1-5

#

so

#

im trying that next

sinful pawn
woven oriole
#

Merry chwistmas

#

๐Ÿคถ ๐Ÿ›’ ๐Ÿ›ค๏ธ ๐ŸŽ โžก๏ธ ๐ŸŽ„๐Ÿ ๐Ÿ›Œ

woven oriole
humble copper
#

watch eric make day 25 the hardest day on the whole calendar because he thinks it would be funny

woven oriole
#

he can ruin the day

#

๐Ÿ˜Ž

maiden brook
humble copper
#

given this list of 500 coordinates, find the real cities these coordinates map to, and give the lowest possible cost to travel city to city, assuming each day a different city is visited and, and each night you must stay at a hotel in the city you just entered.

maiden brook
#

that sounds like christmas

candid berry
#

part 2: Assuming you have COVID at the start of your trip, how many people will have it at the end, given the populations of each of those cities and the sizes of their airports, and assuming the Omicron variant of SARS-CoV-2 infects one out of every thousand people exposed to it each day.

hidden musk
#

part 3: find the bomb I've hidden in your house, what is it's serial number

humble copper
woven solar
#

reverse-engineer the bomb's cryptographic handshake and determine the disarm code. You have 3 tries before the bomb explodes as an anti-tamper mechanism.

humble copper
#

star reset

#

is that even possible

steel bear
#

Happy Christmas at least in asia ๐Ÿ™‚

#

what are you guys doing after AOC ? Leetcode?

#

AOC was really fun though learnt graph traversal, dijkstra and lots of code golfing XD

woven oriole
#

last time we all will summon

#

โ˜ฎ๏ธ

hidden copperBOT
humble copper
#

merry christmas east coast!
ยกfeliz navidad!

potent pumice
#

Due to strong water currents in the area, sea cucumbers that move off the right edge of the map appear on the left edge, and sea cucumbers that move off the bottom edge of the map appear on the top edge.

hidden musk
pine tiger
#

way too close

peak dock
#

lol are d25 part 2s always like this

woven solar
#

yes

prisma sundial
#

gg everyone, gl next year ๐Ÿ™‚

humble copper
#

||im simulating right, but its not stopping after the expected amount of steps||...

earnest forge
humble copper
#

i am

#

i checked the sample

#

the individual steps look fine

#

but its not detecting when none move

earnest forge
#

If you're ||comparing lists||, consider ||just counting the moves you make manually|| instead

#

Personally I ||wrote a function which does the move, and counts how many things it moved|| which is probably a similar idea to what everyone else did

tulip elbow
#

Merry Christmas!

earnest forge
#

Merry Halloween Christmas!

tulip elbow
#

lolol

humble copper
#

nevermind i was checking the wrong input

#

ooops

#

so im assuming as the time between moving everything reduces, the grid gets closer and closer to solving?

woven sable
#

Now all that's left is D23 and D25

sinful pawn
#

still waiting for 3DS

earnest forge
earnest forge
#

D4, D6, D8, D12, D20

#

Tbf people have made a D3, which is basically just a triangular prism

#

(and a D2, otherwise known as a coin)

woven sable
#

or was it Day 21

#

the Dirac Dice

earnest forge
#

Hah

#

Yes, d(split universe)

woven oriole
hollow wharf
#

Merry ๐ŸŽ„๐ŸŽ„โ›„

#

Christmas

humble copper
#

it's been a hell of a ride

woven oriole
humble copper
#

thats cool

crystal shard
#

hell yea

balmy dome
crystal shard
#

what is it

woven oriole
#

trench

balmy dome
#

French?

#

Lol

woven oriole
#

depth of sea

#

we are at the deepest point

#

hehe

balmy dome
#

๐Ÿ˜†

#

So deep lol

pearl moon
#

Is there a non brute force solution to 25

woven solar
#

it's fine to do it the naive way - remember that (this is a minor spoiler for day25 part2 of every AoC year) ||there's no part2, so the part1 is all there is||

woven oriole
#

why will you call it brute force in the first place

#

๐Ÿ‘€ ||its just quadratic solution||

mint hornet
#

Wow, this is beautiful roowow

sonic silo
#

pretty lights

hollow wharf
#

omg the size of the input

hollow wharf
woven oriole
minor hamlet
hollow wharf
#

let's gooooooooooo

minor hamlet
#

I gave up aoc on day 9

#

got too hard

#

for me

woven oriole
#

you can always reattempt it again in your life โ„ข๏ธ

minor hamlet
#

its just so confusing

#

I don't understand how ppl are able to do this so easily

hollow wharf
#

ooooh I know what the calendar is now

hollow wharf
proud cosmos
#

Happy life

#

Wouldn't call it easy yeah

#

for some days I invested my entire day essentially

#

but it feels so good

muted aurora
#

Please tell me today's was not another head scratcher

#

I just want my 50 stars but I'm done thinking

proud cosmos
#

It was easy

#

I had some stupid issue I didn't get for a while but you can probably do it in like a few minutes

muted aurora
#

Can I just brute force it?

#

Ah right no part 2

proud cosmos
#

Yes

muted aurora
#

Cool

#

Thanks

rancid creek
frigid mural
muted aurora
#

solution takes forever, but we did it boys:

frigid mural
#

๐ŸŽ‰

#

how long did ur solution take?

#

mine was second-guessingly slow

muted aurora
#

20 seconds lol

frigid mural
#

5:49 :) cos i couldnt be bothered to make it efficient

muted aurora
#

couldn't be bothered to check if I would overwrite stuff, so just making multiple copies every time

proud cosmos
#

wow mine is acutally decently fast then

#

~2s

#

lol

rancid creek
#

Yeah, mine was instant too.

wooden jewel
#

I am in spain but the s is silent

steel bear
muted aurora
muted aurora
#

oddly satisfying to watch

maiden brook
#

reminds me of snow on christmas morning

steel bear
#

I am seeing a pattern but couldn't quite describe it

maiden brook
#

or just really bad traffic

muted aurora
#

going to post a longer version, just compressing it

#

screen recordings on my computer are hugee

woven oriole
#

oh i should do this with carriage return

muted aurora
#

I'm just using an ANSI code to just to the top

#

no fancy library

#
while True:
  print(chr(27) + "[2J")
  # perform step
  print_grid(cur)
  os.sleep(0.1)
devout tusk
mossy stream
muted aurora
humble copper
#

btw merry christmas everyone

#

and happy holidays

maiden brook
#

merry christmas ๐Ÿ˜„

#

see you all next year
(jk I'll be around)

steel bear
#

Merry Christmas ๐ŸŒฒ

proud cosmos
#

Merry hristmas

iron reef
#

This was strangely easy

#

The brute force is so fast

sleek cave
#

day 25, finally a not-so-hard puzzle :D

#

anyways merry Christmas guys!!!

#

what an event

#

absolutely amazing

#

(even though I basically couldn't do anything after day 18 except for day 20 lmao)

#

I might reattempt the harder puzzles when I have time... waiting for that one day when I'll finally get 50 stars lol

#

also @woven oriole congrats! our first cat dev completionist

frigid mural
#

Merry Christmas to all of you, 'twas a fun ride with some really great people. I'll see y'all around :) ๐Ÿ‘‹

maiden brook
#

so long, and thanks for all the lanternfish

frigid mural
#

its kinda sad theres only 25 days of advent

steel bear
woven oriole
#

started out with numpy ๐Ÿ‘€

#

i shall too lets go

woven oriole
wooden jewel
#

I said previous weekend "I think we had the worst part, should be relatively smooth sailing from here on out"

#

Oh how young and naive I was

unreal willow
#

could someone explain?

#

pls

woven sable
# unreal willow could someone explain?

Well, they all move simultaneously so when the sea cucumber you circled in the first step tries to move and wrap around, it takes that state meaning that the other sea cucumber is blocking it so it doesn't move

woven oriole
woven sable
#

Np!

ancient geyser
#

Data Analyst or Data Engineer ?

wooden jewel
#

Data Lanternfish

ancient geyser
#

hahaha

#

Lanternfish?

wooden jewel
#

(I'm joking, you're in the channel for advent of code, which is a yearly event around this time)

sleek cave
#

numpy. is. amazing.

proud cosmos
#

Nice!

sleek cave
#

all the times when i did sum(bruh < something for seq in 2dseq for bruh in seq), i could've just numpy'd lmao

proud cosmos
#

To be fair that is not relaly that much worse in my opinion

#

but it is nice it works

sleek cave
#

so many early days can be solved elegantly with a few lines of numpy

#

the later days, not so much, but the early days with numpy is :chefskiss:

#

YOU CAN EVEN SPECIFY AXES AND CUMULATIVE SUMS?!!

#

i'm in love halp

wooden jewel
#

don't tell this guy about array programming languages :P

sonic silo
#

dont tell him about matlab or R or julia, or he goin crazy

wooden jewel
#

julia is an apl

#

can't change my mind

candid sigil
sonic silo
#

ยฏ_(ใƒ„)_/ยฏ

#

maybe one day i'll revisit R

#

i just touched that lang ever so slightly during my statistics class in my first year of college

candid sigil
#

It has always felt more natural than Python for data manipulation to me, although I'm biased in R's favor because I learned it first. It does have more quirks and questionable implementation decisions than Python, though.

sonic silo
#

that's saying a lot about R's implementation lmao

candid sigil
# sonic silo that's saying a lot about R's implementation lmao

I don't think it has any truly awful features, but I would get rid of stuff like partial argument matching if I had the power. There are several elements like that that feel like relics of a time when R was mostly used interactively or for small analysis projects.

hollow wharf
#

kinda confused, i just randomly decided to program the final day
i'm done programming it but I'm confused what the input is, it came from the previous day didnt it? does anyone have it?

humble copper
#

day 25?

#

the input is the same as always

#

if you mean part 2 then ||you need to fully complete all other days in the calendar to finish part 2||

hollow wharf
#

it's my first day trying it so i dont know what it usually is

#

oh its at the bottom

woven sable
#

Until when do we have time to complete the 50 stars to get the AOC Finisher role?

wooden jewel
#

Is that automatically applied?

hollow wharf
#

It will be automatically applied and will run until February iirc

sonic silo
#

do i not get the role

humble copper
#

yeah if you get all 50 by january you get the aoc completionist role

#

so that gives you roughly 5-6 days

sleek cave
humble copper
#

well thats just if you want the role

sleek cave
#

although i am learning numpy now and it's absolutely amazing

sleek cave
#

i won't be able to get it, these puzzles just get way too hard for me (for now)

#

next year i'll see if i can beat this year's score

narrow crown
#

๐Ÿ˜ I'm already at day 4

#

definitely will be able to finish the rest before january

narrow crown
humble copper
#

youtube tutorials might be useful

narrow crown
#

ty

hollow wharf
sleek cave
narrow crown
sleek cave
sleek cave
#

day 19, 21, 22, 23, and 24 are just :sigh:

hollow wharf
#

We did all the 50 stars without any external libs

#

That's very much doable without numpy

narrow crown
sleek cave
#

ah yes, input49.py
imposter spotted

proud cosmos
#

ah yes

#

i

#

sad

sonic silo
#

i

sleek cave
#

what a ride

#

welp, i may not have saved christmas, but i got 40 of them shiny stars lmao

#

double my initial goal

#

this has been such a fun event, i absolutely love aoc

#

will come back to the harder puzzles later to see if i can get 50 stars lol

muted aurora
#

@sleek cave ayy, at least you got your 40! nothing to scoff at

#

some of the later ones were very hard

sleek cave
#

taught me so much stuff

#

absolutely amazing

candid sigil
#

I got 36. More I think than last year. Not sure how much further I'll go, though I would like to finish off part 2 of day 21.

narrow crown
#

i got 8 B)

sleek cave
#

yeah, I didn't even understand part 2 lmao

#

universe trifurcation, can't be me

candid sigil
#

I knew from the reference to Dirac that ||quantum nonsense|| would be in part 2, but nothing like that.

ruby epoch
#

12 โญ๏ธ here

candid berry
#

Day 22 took me a while, but day 19 absolutely wrecked me

#

That took me 9 straight hours, by far the worst I did on any of them

#

My second worst was 5 hours for day 23

sleek cave
#

others are unattempted

woven solar
steel bear
#

wait wdym by day 26 , isn't it until day 25

crystal shard
steel bear
hidden copperBOT
woven oriole
#

lmao

hybrid schooner
#

well at least i tried

#

xd

robust heart
#

I'm taking AOC at my own pace imo

#

As long as I can find a solution

#

I just hope I can ask for questions even after December ends

woven oriole
ruby epoch
# hybrid schooner

You got slightly further than I did. I finished day 6, but didnโ€™t start day 7 yet

sleek cave
#

I'm so inspired by this event, I want to make my own aoc called "are you smarter than a (snailfish) fifth grader," which would be basically 14 puzzles released over a week that only regard snailfish math

#

and each day is a higher grade ending at gr5

hollow wharf
#

nO

sleek cave
hollow wharf
#

We still have nightmares of that day

sleek cave
#

snailfish multiplication :evil:

sleek cave
#

but this is a project once I get more experienced. will probably start working on it in 2 to 3 months after I've done more aoc puzzles from past years

hollow wharf
#

yy

#

hw are you doing

muted aurora
sleek cave
#

i'd greatly appreciate you collaborating!

sleek cave
woven sable
#

I'd love to help too ^^

sleek cave
#

i see fronto typing furiously
too late he already sent message lmao

woven sable
#

Lmao

sharp panther
#

sounds fun

sleek cave
#

lessssgo!! perhaps if we get enough people and enough puzzles, we could ask event team to make this an actual event?

#

okay let's not get too ahead of ourselves lmao

muted aurora
#

Probably just do a trial run first to see how it goes ๐Ÿ˜…

sleek cave
#

yeah, my bad, got too hyped

woven sable
#

But if we did make puzzles and what not, it should be its own thing and have a totally different concept than AOC

sleek cave
#

i've been thinking about this ever since day 18 released

woven sable
#

Did doing the homework for snailfish inspire you lol

sleek cave
#

i was simply inspired by snailfish lol

sleek cave
#

if y'all want, maybe we can discuss details in a private server/group chat?

sleek cave
#

@muted aurora @woven sable @sharp panther sent y'all links!

proud cosmos
#

Nice

#

Making puzzles is hard otherwise I'd love to help

#

But I'm pretty bad

muted aurora
#

On the contrary, I'm terrible at organizing anything, but making puzzles and programming challenges I can do

minor pike
river hollow
#

I don't think the .aoc leaderboard commands knows my AoC user name, and can't place me on the leaderboard. Is there a way to link it?

hidden musk
#

yep

#

uhh, let me find the command. i think it's .aoc link

river hollow
#

Thanks!

#

\o/ that worked

hollow wharf
#
with open("Day3\input.txt") as f:
    lines = f.readlines()
    lines = [line.replace("\n","") for line in lines]


def common(list,index,rule):
    ones = zeros = 0


    for bin in list:
        if bin[index] == "1":
            ones += 1
        else:
            zeros += 1

    if rule == "oxygen":
        return "1" if ones >= zeros else "0"
    else:
        return "0" if zeros <= ones else "1"



def pick(lst,common,index):
    res = []


    for bin in lst:
        if bin[index] == common:
            res.append(bin)

    return res

def get(rule):
    lst = lines.copy()
    pos = 0
    

    while len(lst) > 1:
        
        lst = pick(lst,common(lst,pos,rule),pos)
        pos += 1


    return int(lst[0],2)

oxygen = get("oxygen")
carbon = get("carbon")

print(oxygen * carbon)
#

yo guys what can i improve on

#

in this solution

#

it's for the 2nd part of the 3rd day

digital ember
cyan sleet
# hollow wharf ```py with open("Day3\input.txt") as f: lines = f.readlines() lines = [l...

Embrace the niceness that is list comprehension and generator expressions. With it kinda makes it hard to justify not inlining pick.

def pick(lst,common,index):
    return [bin for bin in lst if bin[index] == common]

You could similarly do

ones = sum(bin[index] == "1" for bin in list)
zeros = len(list) - ones

also in your input reading you could do line.strip() rather than the replace.

candid sigil
#

Starting day 16 now. Keeping track of the length of packets is going to be a nightmare.

muted aurora
#

@proud cosmos I'm giving up on trying to optimize my Day 23, can you pls send your code, I'm just going to adapt from that to get the speed

proud cosmos
#

is my day23 that fast?

muted aurora
#

mine's like 22s didn't you say you got it down to like 2s

proud cosmos
#

its 5s atm not sure what I did

#

I also feel like I had that faster at one point

#

oh well

muted aurora
#

well either way still significantly faster than mine

#

and idk what I'm breaking with dijkstras

#

oh wait right your day 23 didn't work properly did it

proud cosmos
#

it should now

#

it was me having weird seen

#

this is my code atm

#

I should remove the prints ig that would help

#

also heuristic is just 0 atm.

#

i still haven't found one that really worked..

#

I'm confused now why is my "is_finished" 4 permanently

#

that looks wrong

#

It gives the right result, weird.

#

oh that's just that one first check ig that's fine

#

Not sure why it being set to amount breaks it though this makes no sense sometimes.

#

so my is finished check being correct breaks stuff haha..

#

Yeah my day 23 code is just pure confusion for me now I am not sure what is happening

#

I should just rewrite this.

#

(it was heuristic not being 0 that broke it oops.)

#

my heuristic almost gives right result but not quite

#

:(

#

would be so good

muted aurora
#

well that seems essentially identical to mine, I meant more like the actual code to find the moves and stuff

proud cosmos
#

I see

#

I'll just give you everythig just uh

#

its a mess

#

I can definitely make this better..

#

I'd assume the worst thing of your code is you using objects for the states right?

#

or am I misremembering

#

cause my stuff is just strings

muted aurora
#

even so

proud cosmos
#

My get possible moves function really isn't good

muted aurora
#

same issue for my C implementation, where I would suspect there's not much ovrhead since I'm hashing manually

#

I feel like there's some algorithmic thing I'm messing up

proud cosmos
#

Yeah well.. I feel kinda bad for even showing you that code

#

it's a lot of things that have been created cause of other reasons but never fixed

#

like me going through rooms in reverse order is what I did cause I used to have this as a generator and that seemed smarter (?) now kinda useless especially since I search everything atm..

#

Also didn't know this was the non spoiler chat

#

oops.

#

Yeah I need to rewrite this..

rancid quarry
#
lines = input.read().rstrip().splitlines()
cucumbers = [[] for x in range(len(lines))]

i = 0
while i < len(lines): 
    for line in lines:
        for c in line:
            cucumbers[i].append(c)
        i += 1

#above can be ignored
k = 0
j = 0

cucumbers2 = [[]]

for line in cucumbers:
    for cucumber in line:
        cucumbers2 = move_east(cucumbers, k, j)
        j += 1
    j = 0
    k += 1

can someone help me? I really dont understand how when i assign cucumbers2 to the result of move_east(), the list cucumbers changes itself?

#

its not like im assigning cucumbers2 = cucumbers, im only assigning it to a result of my function so i dont get how cucumbers2 and cucumbers are related

proud cosmos
#

what does move_east do

#

(as in show the function)

#

it probably manipulates the original list

rancid quarry
#

thats what i thought too, but then i changed the variable name and it still changed both lists

#
def move_east(cucumbs, pos1, pos2):
    if cucumbs[pos1][pos2] == ">":
        if pos2 == len(cucumbs[pos1]) - 1 and cucumbs[pos1][0] == ".":
            cucumbs[pos1][0] = ">"
            cucumbs[pos1][pos2] = "."
        elif pos2 != len(cucumbs[pos1]) - 1:
            if cucumbs[pos1][pos2 + 1] == ".":
                cucumbs[pos1][pos2 + 1] = ">"
                cucumbs[pos1][pos2] = "."
   
    return cucumbs
#

its messy code but im just trying to get it to work

cyan sleet
#

variable name doesn't matter

proud cosmos
#

Yea

cyan sleet
#

it's still referring to the same list

proud cosmos
#

^

#

make a copy in move_east first, or similar

#

For 2d lists a bit annoying might be nicer to just change the solution to always use the new list

rancid quarry
#
def move_east(cucumbers, pos1, pos2):
    cucumbs = copy.copy(cucumbers)
    if cucumbs[pos1][pos2] == ">":
        if pos2 == len(cucumbs[pos1]) - 1 and cucumbs[pos1][0] == ".":
            cucumbs[pos1][0] = ">"
            cucumbs[pos1][pos2] = "."
        elif pos2 != len(cucumbs[pos1]) - 1:
            if cucumbs[pos1][pos2 + 1] == ".":
                cucumbs[pos1][pos2 + 1] = ">"
                cucumbs[pos1][pos2] = "."
   
    return cucumbs

``` so like this?
cyan sleet
#

does copy do a deep copy?

#

I've never bothered with it

placid lake
#

nope, use copy.deepcopy

cyan sleet
#

I would personally do something like

cucumbs = [row[:] for row in cucumbers]
rancid quarry
#

ok thanks

candid sigil
#

Giving up for now. I just can't think of an algorithm that would work.

proud cosmos
#

for?

livid gull
#

advent of code 2015 almost done

steel bear
#

I am at Day 23 almost getting it ๐Ÿ™‚

sleek cave
#

@digital ember @steel bear sent y'all links!

normal umbra
#

Hey there. I am trying to solve day 4 (got a bit late lol). So solving part 1 was very easy, but I am stuck on part 2. The final answer I am getting is too high. Anyone got any tips or something? Nvm got it

late linden
#

@woven solar

#
define(`strlength', `ifelse($1, `', 0, `eval(1 + strlength(substr($1, 1)))')')

strlength(foo)
#

this is m4

#

a macro language like the C preprocessor.

#

this is a recursive macro that calculates the length of a string.

#

look on in horror.

#

OH SHIT

#

THIS IS THE ADVENT OF CODE CHANNEL SORRY

sonic silo
#

man

#

i wanna get done with all my work for this christmas

#

so that i can begin solving aoc puzzles from prev years properly agian

muted aurora
#

2015 so ez compared to this year lol

woven sable
#
livid gull
muted aurora
#

started with a, and tried to recursively compute the things it was dependent on

#

that way I don't need to worry about any extra wires that don't do anything

livid gull
#

i just kept track of the registers?wires? that had an integer value and then if another one used them i could then add that to the ints and iterate over them

muted aurora
#

I tried doing that too but since each of the things could be integers/wires it got a bit annoying the way I was doing it

#

and I was getting way too many wires when printing all the values out to debug

#

so doing it backwards helped with that

#

didn't spend too much time trying to think of a decent way tbh, just wanted to get stuff working

#

all my days are just basically hacked together LOL

#

I cheesed day 8 so hard lol, just used eval() and repr()

livid gull
livid gull
muted aurora
#

count?

livid gull
#

s.count("\") + s.count('"')

#

2 slashes

#

i dont know why discord keeps them hidden

muted aurora
#

ah lol that's smart

livid gull
#

...

#

how do i spoiler code?

#

||print(sum(len(s) - len(eval(s)) for s in open("Day8.txt").read().split("\n")))
print(sum(s.count('\') + s.count('"') + 2 for s in open("Day8.txt").read().split("\n")))
||

sinful pawn
livid gull
#

i guess you get no syntax highlighting then lol

sinful pawn
muted aurora
#

this is for 2015, I don't think many people are trying to do it I guess

sinful pawn
#

oh

#

2015

hollow wharf
#

i know a good code

#

=SUM(A10:A15)

wispy glacier
north mist
#

what is the advent of code

narrow crown
#

pain and suffering for a person like me :P

delicate dirge
#

found the people at the top of the global leaderboard

peak dock
#

I have completed aoc 2021!

hidden musk
#

๐ŸŽ‰

woven sable
narrow crown
#

I have completeted aoc day 4!

woven sable
narrow crown
#

lol ive about given up on aoc this year now

#

my coding skills are not nearly that good

woven sable
narrow crown
#

lol true

#

instead ive been working on this other program

pallid shoal
#

Hi

rose fable
#

I completely forgot about this until now but I figure I'll do it as an exercise

steel bear
muted aurora
steel bear
muted aurora
#

Try it if you have some time to kill, the first 15-16 days are all pretty easy

radiant grail
#

Can anyone please explain how to use advent of code

woven sable
radiant grail
#

Is that it?

woven sable
#

Yep

main edge
hollow wharf
#

how can i export the json data to a txt without 1 thing

hollow wharf
#

get this error when i wanna install psutil

#

why?

steel bear
# hollow wharf

the error shows your microsoft visual c++ is not updated, maybe try updating it ?

steel bear
hollow wharf
#

its python

#

i thout u told me vsc

steel bear
hollow wharf
steel bear
# hollow wharf why c++

Windows Python needs Visual C++ libraries installed via the SDK to build code, such as via setuptools.extension.Extension or numpy.distutils.core.Extension. For example, building f2py modules in Windows with Python requires Visual C++ SDK as installed above. On Linux and Mac, the C++ libraries are installed with the compiler.

https://www.scivision.dev/python-windows-visual-c-14-required/, just did a google search ๐Ÿ™‚ ๐Ÿ™‚

normal umbra
#

Hello. Can someone help me understand day 7 problem? I don't even understand what I have to do ๐Ÿ˜•

cyan sleet
#

You're given a bunch of x positions of crab submarines, you are given how much it costs for them to move along the x-axis, what's the minimum cost to get all to the same x position?

normal umbra
cyan sleet
#

three of them are already at x=2

normal umbra
#

oh

#

so there can already be more than one at one point

#

there position in the list has nothing to do with the fuel cost right?

cyan sleet
#

it's one line per x value in the list above

#

no

normal umbra
#

Alright thank you

livid gull
#

if i need a sorted stack what library do i need to use?

proud cosmos
#

Depends on what exactly you mean but probably something like a heap

#

not exactly sure how sorted and stack work together

#

tbh

livid gull
#

idk data structures lol, what is normally used for dijkstras

velvet stag
#

heapq

sleek cave
livid gull
#

ty both

#

well thats reduced my time from 8 seconds down to 1.8 seconds

normal umbra
#

For day 8 pt 2, do I have to like, read the sequence of strings on the left of the | and figure out what the pattern of the abcd is? Like its different for each line?

ruby epoch
normal umbra
#

Ah fuck lmao

#

Thanks for the confirmation

ruby epoch
normal umbra
#

I was just giving it a read, altho I am going to have dinner rn. I will start solving it a few hours later. Mind if I ping you then?

ruby epoch
#

Sure

normal umbra
#

Sweet

lost dust
#

Complete noob, i was wondering if anyone could guide me with the seconds puzzle. I think i need to use array slicing but not sure

#

Do i need to delete /n from the text file

proud cosmos
#

\n is a "newline"

#

I don't think it's part of the actual input in any of the days this time

#

so yeah you can just remove it

#

(well, or split at it, cause usually every line means something else)

lost dust
#

how can can I remove or split it? @proud cosmos thank you

proud cosmos
#

Strings have a .split method that does just that, removing probably with .replace