#advent-of-code

1 messages Β· Page 17 of 1

woven sable
#

bc there's no benefit for the ||J's to be different if there's more than one||

noble skiff
#

i mean it's a lot simpler than that, ||all the jokers should always be the same as your most frequent card||

dense osprey
#

oh yea but then it would be greedy and not purely naive anymore

ripe meteor
#

This is the one thing i checked actually

#

||there werent any||

noble skiff
#

it's pretty easy to convince yourself that's true; imagine yourself with any given hand, add a joker. what the joker should be is always the same ||the most frequent card you already have||

simple raven
dense osprey
simple raven
#

oooooh it doesn't because ||we are not replacing|| omfg I made it soooooo much harder for myself in so many ways with my first solution...

noble skiff
#

yeah

dense osprey
#

im too lazy to implement this tbh

noble skiff
#

I think it's pretty deliberately designed to be this way; to actually make the joker substitution very simple

#

if there were real poker hands, or if the joker actually became teh card for tie breaking purposes then there would be at least some logic around choosing what to make the joker

#

as it stands there's zero; I never actually explicitly choose what the jokers will be in my code

woven sable
#

oops idk why i went the naive way

#

whb i could've j done that

dense osprey
#

why were todays and yesterdays problem so easy compared to the problems before

torn sapphire
#

the questions are all laid out by a single dude, and noones perfect at laying out problems 🀷

noble skiff
#

if you consider that day 5 part 2 worked with brute force, i'm not sure there really was a big difficulty spike

#

doing day 5 part 2 "properly" has been easily the hardest thing so far but it's not necessary

woven sable
#

u could brute force it??

torn sapphire
#

according to the stats page, day 5 does have less 2-star completions than day 6

woven sable
#

i got a java heap error πŸ’€

simple raven
# noble skiff I think it's pretty deliberately designed to be this way; to actually make the j...

witness my silly solution
||```py
def replace_jokers(self, hand_type, hand):
if 'J' not in hand:
return hand_type, hand
card_count = Counter(hand.replace('J', ''))
#case 3333J
if hand_type == '4':
hand_type = '5'
#case QQQJA
elif hand_type == '3':
hand_type = '4'
#case QQQJJ or JJJ22
elif hand_type == 'fullHouse':
hand_type = '5'
elif hand_type == '2':
#case KKTTJ
if all(x[1] == 2 for x in card_count.items()) and len(card_count) == 2:
hand_type = 'fullHouse'
#case KTJJT
else:
hand_type = '4'
#case 2388J or 23J8J
elif hand_type == '1':
hand_type = '3'
#case 2348J
elif hand_type == 'highCard':
hand_type = '1'
return hand_type, hand

dense osprey
noble skiff
#

although I guess to brute force 5p2 in python you need to at least use multiprocessing, or do the clever/||reverse|| brute force

#

yes, I agree

dense osprey
#

while todays problem is supposed to be solved in a naive/greedy way

woven sable
#

what's greedy πŸ’€

noble skiff
#

you can't pick the difficulties perfectly

royal gull
woven sable
#

i bet u tmrs gonna be a pathfindinh or flood fill problem

#

it's always around this time

#

that we get the first one

noble skiff
#

also in the end I think difficulty is more oriented around completion than doing it the way you're "supposed to"

dense osprey
#

wait how do i do multiline spoilers

#

||x
x
x||

simple raven
royal gull
#

Spoilers should really go in the daily spoiler channel

noble skiff
#

i think that part of the design in 5 is that the actual input size isn't huge (depending how you look at it), which gave brute force a chance to work.

woven sable
#

are u talking about a diff day

#

oh wait nvm

#

the size itself wasn't big

#

but the numbers were hugee

#

made brute forcing each ||individual seed|| hard

royal gull
#

Can you put this in the daily solution thread? Not here plz

noble skiff
# woven sable what's greedy πŸ’€

greed just refers to algorithms that make the best "immediate" move.
Like when you try to find a minimal spanning tree for a graph, there's a greed solution to always pick the cheapest path that connects an unconnected node.
it's not obvious by inspection that this "greedy" algorithm is optimal, but it actually is

zenith elbow
# woven sable what's greedy πŸ’€

a technique where you choose to do something that gives you a better answer first. like in finding elements in an array that add up to a sum, you could say to pick the largest number smaller than given sum and go from there

woven sable
#

ohh

#

i see

noble skiff
#

there isn't really a good example yet this year of a greedy algorithm, except maybe in a trivial sense

woven sable
#

i struggled w part 1 bc i spent 10 min tryna make a custom comparator in kotlin bc u can't compare lists

noble skiff
#

unless i'm forgetting something

woven sable
#

and then i j manually checked each index

zenith elbow
noble skiff
#

yeah, there hasn't really been any optimization problems which is where you see greedy

runic drift
#

Can anyone look at my day 5 solution and tell me why it’s not working

muted aurora
runic drift
#

I’m what?

#

It says #Unknown @muted aurora

#

@muted aurora just sent it

dense osprey
#

huh how did this code even get the correct answer

rancid creek
dense osprey
#

but it somehow does

simple raven
#

so like 15 last year, 8 or 16 2 years ago and 16 or 19 3 years ago, cool

zenith elbow
#

what's with the day 1 spike in 2015 I wonder

modern terrace
jovial jay
#

actually, too afraid to think about it, it's probably bad, very bad

#

ok, i see 2015 outliers, now i need to take a check at that problem

#

2015 day 19 doesn't look too bad. still nothing like day 5 of this year i think

honest nacelle
noble skiff
#

So the plot is extremely misleading

#

Although day 5 certainly still seems to be an outlier

woven sable
#

u can fix the y axis

mossy basin
#

why axes?

honest nacelle
jovial jay
#

Can we do AGC assembly for next roulette?

honest nacelle
#

never would've expected a leaderboard dev to use idle

rustic cobalt
#

pretty amazing stuff

#

what if I want to read the little elven stories?

#

..or maybe they do..

jovial jay
honest nacelle
minor cave
#

Language Roulette: Day 8
The language is ... Bash

mossy basin
#

oof

magic oxide
#

damn bash

#

hope today isn't too hard

mossy basin
#

gonna bash your keyboard

honest nacelle
#

f

earnest forge
#

Good luck everyone

honest nacelle
#

🫑

earnest forge
#

you know, bash might be less painful than prolog lol
I'm not doing the language roulette but still

honest nacelle
#

Who has a prolog solution up? I wnna see it

zenith elbow
shut trellisBOT
magic oxide
#

ooh nice

#

finally one of these problems

#

glhf leaderboarders

honest nacelle
#

I can tell this is gonna be a CPU-killer in part 2..

pine tiger
#

what are the odds

#

same rank both parts

feral hazel
#

31 / 10 wooo

jovial jay
#

Leaderboard is now filled?

feral hazel
#

spoiler channel isn't up?

pine tiger
#

not yet

jovial jay
#

Closer to solving day-5 now πŸ™‚

timber glacier
#

how many steps did your part 2 take

pine tiger
timber glacier
#

how

untold briar
#

Can someone pls explain this part for me

Of course, you might not find ZZZ right away. If you run out of left/right instructions, repeat the whole sequence of instructions as necessary: RL really means RLRLRLRLRLRLRLRL... and so on. For example, here is a situation that takes 6 steps to reach ZZZ:

pine tiger
mossy basin
#

my best finish

untold briar
#

I see clearly that you just need to do LR

#

How did that become 6 steps?

#

RR works too

timber glacier
#

the second exmaple is 6 steps

#

the first example is 2 steps

untold briar
#

Yeah and the 2ns example confuses me

#

Start at AAA, go either left/right to reach BBB

pine tiger
untold briar
#

Then go right to reach ZZZ

#

How did that become 6 steps?

timber glacier
honest nacelle
pine tiger
#

wait how did that work what???

timber glacier
#

bro

#

what

untold briar
#

Hmm yeah I would punch the guy who made this map

timber glacier
#

idk what you're trying to do with ||lcm||

untold briar
#

Why do you make me take 6 turns in a desert when I can get out of it in 2 turns

compact wasp
#

i started late again oops

timber glacier
#

my code has already gone through 1,000,000,000 steps and more for part 2

woven sable
#

i could've gotten on the leaderboard lowk for part 1

#

too lazy to open my comp th

timber glacier
#

same

woven sable
#

so i j read the prompt

timber glacier
#

i was too slow to understand

woven sable
#

i'm worried ab part 2 tho

compact wasp
#

and i completely forgor to do it yesterday

woven sable
#

ik it's some brute force thing

#

tired of these problems 😭

honest nacelle
#

I kinda like them, make you think a bit

compact wasp
timber glacier
#

bruteforcing is taking forwever, I don't think it's a valid way of doing it

woven sable
#

some of them are fun fs

#

but day 5 was so bad for me idk why

timber glacier
#

how is it ||lcm|| though? That makes no sense

timber glacier
honest nacelle
#

I thought I could relax but there's a guy on my private leader board who also has part 1 I'mma panic

compact wasp
timber glacier
#

that's making no sense

compact wasp
#

you're talking about part 2 right?

#

for day 8?

timber glacier
#

oh

#

wait

compact wasp
timber glacier
#

OH I GOT IT

timber glacier
#

kik'

zenith elbow
# timber glacier how is it ||lcm|| though? That makes no sense

if we imagine each ghost to start on a node ending with A, ||the number of steps (let it be X) needed for each of them to get to Z is independent of each other||, and ||once they get to Z, when we continue following instructions they just keep cycling every X steps||

timber glacier
#

too late

zenith elbow
#

:')

humble copper
#

need a general hint for part 2

timber glacier
#

||lcm||

#

i don't understand how it works, but it does

#

because how would you know if the ||Z makes that node start all over again instead of going for a few more then starting again||

humble copper
#

time to implement it without the math lib, shouldnt be too bad

timber glacier
#

why without?

humble copper
#

tryna do no imports

flat sequoia
#

the inputs are just generated so that it works

timber glacier
#

thought so

flat sequoia
#

you can just explicitly check for a cycle instead

covert arrow
#

AHHH I FORGOT

#

I am at a swim meet

compact wasp
#

rip

covert arrow
#

and it just happened that my heat is right when aoc opens

compact wasp
#

i also realized that the code i wrote wasn't working for automatic example parsing πŸ’€

covert arrow
#

I did get a 50 free pb though (29.19)

zenith elbow
#

nice one!

humble copper
zinc kindle
#

Right. Psrt1 was easy. Assumed part2 would involve finding the shortest paths, was glad I was using rust because of the 3rd party pathfinding module. ||I was wrong||
After some time in part2 ||trying to convert it to using a vec and sorting it, then hashset, then finding it was taking too long|| realized I just needed ||lcm of all the times (well, used GCD, realized answer was obviously wrong, replaced with LCM and it worked). Unfortunately, rust doesn't have lcm included, so I needed to import it, and a short function using reduce to use it on all elements||. Still, managed a significanlty better part2 rank than part1 (still not in top 1000 though).

naive stone
#

there's some kind of trick to this isn't there

covert arrow
compact wasp
#

i should've gotten onto the leaderboard but i didn't bc i didn't think ||lcm|| would just work

pine tiger
zinc kindle
# covert arrow wait how does ||lcm|| just work?

||my intuition/hope was that the time for start to dest1 would be time for dest1 to dest2. In retrospect, this might have not been guaranteed, but it worked. Also, it turns out that gcd of all times !=1, so that might be related||

covert arrow
zinc kindle
untold briar
#

Wow 1st place today got 2 stars in 4mins

candid brook
#

I feel like the input is specifically constructed so that ||lcm|| would work. I was thinking about using ||Chinese remainder theorem|| if the ||initial number of steps to reach Z|| is different from the ||loop size to reach another Z||, but apparently they're the same

untold briar
#

So just 4 mins to do everything, including writing a non-brute forcing solution

slate berry
covert arrow
deep ferry
#

Day 8 part 2 is actually so stupid

deep ferry
#

so like how am i supposed to know that it would work? like technically it should have never worked, no?

#

unless im missing something stated in the problem statement

#

in that case, please enlighten me

covert arrow
deep ferry
#

i never want to assume anything by looking at the values. ig im too used to usaco being explicit about everything

honest nacelle
#

Oh god

#

I made it

covert arrow
#

Yup, aoc is a completely different style from usaco and other cp competitions

#

Almost anything is fair game since you have the whole input (except ai ig)

honest nacelle
deep ferry
#

what if it was an acylic graph

#

what if each "cycle" length was actualyl different

covert arrow
brazen bridge
#

How is it even possible to solve part 1 in 38 seconds?

deep ferry
untold briar
#

Ah yes I love today's problem haha

honest nacelle
#

Ooooh... yeah actually

untold briar
#

It makes brute force totally impractical

deep ferry
#

now i think of it, possibly AI

deep ferry
honest nacelle
#

@deep ferry I see what you mean now, ||I assumed the graph cycled immediately after reaching an end node and that happened to be correct||

untold briar
deep ferry
pine tiger
#

relies on input assumptions

deep ferry
#

yea

covert arrow
deep ferry
#

dont get me wrong i love programming

#

and USACO's not bad

honest nacelle
deep ferry
#

but i'd rather be making projects

covert arrow
# honest nacelle What's off there?

||the number of steps before reaching the loop is equal to the number of steps between the end and the start of the loop, so they cancel out||

covert arrow
deep ferry
#

eh W ig

covert arrow
#

And c++ by extension

deep ferry
#

oh

#

try rust

untold briar
#

But the syntax, well...

covert arrow
#

I like rust more ferrisBongo

deep ferry
#

Rust >>

#

maybe even better than Python

#

the one thing i would complain about python is the implicit pass-by-references vs pass-by-value

untold briar
#

Also the code block defined by indentation

#

Could get messy when your code get big

deep ferry
untold briar
slate berry
#

is there private leaderboard for this server?

deep ferry
#

yes

slate berry
#

code?

untold briar
#

No thanks, I already have enough trouble between tab and 4 spaces πŸ˜…

deep ferry
slate berry
deep ferry
#

@placid lake ? the bot used to show the link but now it doesnt... hope this is the right person to ask

untold briar
#

See the aoc-faq channel

#

But there could be other codes?

minor cave
#

run /aoc join

#

it'll give you one

deep ferry
#

ah

untold briar
#

That Dennis Pham leaderboard is not very active

minor cave
#

we technically have 9 leaderboards, because we have more people than a single lb can fit

deep ferry
#

oh so the &aoc and slash commands are different

untold briar
#

Only 20+ ppl still remain in action

#

Most just joined and stay dead lol

minor cave
#

it used to be &aoc join and it would try to DM people. But using a slash command and having it be an ephemeral message is a much nicer solution

#

we also re-use the same leaderboards each year, so there are a few people that joined a previous year and aren't active this year

deep ferry
#

pruning inactive members would be nice maybe

minor cave
#

I might go through after this year and prune people who haven't done a single day on any year

#

but it's also a pita because I need the owners of each leaderboard to do that and that's a lot of cat herding

naive stone
untold briar
#

We are probably in different lb

naive stone
#

yes, there are like 9 of them

untold briar
#

Yeah so in mine, only 48 ever did a start

covert arrow
naive stone
#

oh were you only referring to the leaderboard you're on?

untold briar
#

And 20+ still go on after the disasters that are day 3 and 5

#

πŸ˜‚

minor cave
untold briar
naive stone
#

i'm actually on a few of them, i'm not sure why

untold briar
#

Where do you get the code for all of our lb?

covert arrow
untold briar
#

😏

naive stone
minor cave
naive stone
#

i was curious, the lb command used to output this link

#

is there no way for us to get the full leaderboard anymore?

minor cave
minor cave
#

the link I have is from me testing the fix

naive stone
#

ahhh

untold briar
naive stone
#

i think pastes are probably immutable

minor cave
#

nah, but whenever Chris or Bella wake up and merge in the fix, the &aoc lb command will output a new link with updated results

covert arrow
naive stone
#

submit a PR :)

covert arrow
#

I have no clue how that wouuld work lol

#

I might open an issue for it later

naive stone
#

contributing to our repos you mean?

#

cuz we have great documentation for doing that

covert arrow
#

I know how to contribute, but I don't know how I would implement it

naive stone
#

ah

minor cave
#

If someone wanted to spend sometime and do a cute little page with dynamic results, we store the leaderboard in our redis cache. So theoretically we could pull straight from that and skip the paste service altogether

naive stone
#

that would be cool

covert arrow
#

hmm interesting

long jacinth
#

theres no ||decision making|| in todays task right?

#

||its all just traversing a tree in a cyclic fashion||

covert arrow
#

yeah, if you're gonna store a url to the paste link it may as well just store the leaderboard itself and display it nicely

minor cave
#

anyway, at 2am it is time for bed lemon_sleepy

naive stone
long jacinth
#

isnt that just the assignment?

naive stone
#

i would argue that figuring out the ||cyclic|| nature of part 2 is part of the problem

long jacinth
#

ive only just started reading part 1, so i wouldnt know, if it is, im sorry

naive stone
#

oh gotcha, and no problem!

slate berry
naive stone
#

seems you have a good eye for the problem then

untold briar
#

Yeah I got fumbled at the 2nd example of 1st part, ||cause I initially thought we must find the shortest route or sth||

long jacinth
#

maybe i should start to use libraries for this

#

so i dont have to make my own ||loops and trees||

#

although, i guess it doesnt take much time

woven solar
#

i don't think this problem would be very expressible in e.g. networkx.

untold briar
long jacinth
#

i dont know, but thats my solution

naive stone
#

i feel like i would struggle to adapt all these problems to networkx. Before i realized it was the wrong solution, I wrote a custom ||bfs|| that of course never finished, but the logic was definitely right

long jacinth
#

i mean, you dont

#

you can just make it in a || list or a dict, or whatever|| i guess

#

now that im thinking about it, it probably just needs a ||dict||

woven solar
#

yeah, I represented ||the graph as a [source, destinations] dict|| as I usually do

long jacinth
#

now that im thinking about it, i would probably just use a ||dict || while building my || tree||

#

guess that makes it redundant

#

unless its a P2 thing

naive stone
#

i gotta say, it's pretty hilarious how the bot just does not care about spoiler tags. Isn't that right bot? ||tree||

long jacinth
#

spoiler? hardly know'er

ripe scroll
#

|| santa ||

rocky spire
#

I'm assuming you're definitely not supposed to just simulate part 2 right?

covert arrow
austere basin
#

yo guys, rouhgly how big is the answer to number 2?

#

like what kinda ballpark is it?

rocky spire
#

Well I have an idea, time to get mathy
though this is gonna be the first time I implement the related algorithm sooo...
To debug hell I go

austere basin
austere basin
#

aw man

#

what is it, like trillions??

naive stone
austere basin
#

oh shit

#

welp, 0.2% of the way, LETS DO THISSS

woven solar
#

I dislike how many days of this year are like "this problem is actually much simpler than it would seem because the input is nice on purpose. nothing in the problem description reveals that, you'll just have to look at your input to find that out. If you didn't do that and started writing a general solution, well, sucks to be you!".

#

I generally like how AoC makes you learn to solve problems quickly, but I would prefer not learning how to solve problems incorrectly to be more quick.

naive stone
#

i'm not sure i understand your critique

#

i felt like today's prompt foreshadowed what the ultimate solution needed to be

woven solar
#

You mean, the example? I don't think so, as there are days on which the example fails to reveal the problem's complexity (e.g. day 1 this year), so "the actual input won't have caveats that aren't in the example" would be a bad lesson to learn.

naive stone
#

are you saying you would prefer the example contained all edge cases that are present in the real input?

woven solar
#

I think I mostly just want it to be consistent. As it is, if you want to be quick, you have to guess whether the caveats are there or not. E.g. in today's day, it'd be nice if the problem statement mentioned something like ||'the path always leads you back to the start eventually'|| - then it'd be unambigous what the solution is. As it is, today people who solve the general problem instead of a subcase of it (that the problem statement doesn't say it's limited to) will have just wasted their time. I think this is bad - it's teaching a bad lesson in how to generalize from examples to a solution.

naive stone
#

hmm, i'm not sure i agree. I think adding that would have been a big spoiler. You already can see that it does that in the small example. I don't think it'd be good to hit you over the head with that

covert arrow
rapid wolf
#

I disagree - I mostly want to write a solution should work for all inputs, not just the specific one I am given. There are cases where you can get lucky and not have some edge cases in the input that others do, like I did in d5p2.

magic oxide
#

tho I actually haven't done the puzzle yet

#

so my opinion may change

magic oxide
rapid wolf
#

fun

#

probably my case as well tbh

magic oxide
#

I had a similar gripe 2021 day 24, but it was less bad because it was pretty obvious that brute forcing wasn't the method and you had to analyze the input

#

but i still didn't like it

rapid wolf
#

2021d24 I probably did via a constraint solver, so I wouldn't have noticed.

polar fractal
#

i just discovered advent of code yesterday and i got a question
on the first day i compute that number with my code and then what?
do i just put that number in that textfield online or do i upload my code somewhere and it automatically checks?
and is it the same for any day?

rapid wolf
#

just put the number in

long jacinth
#

you get your input from the website, process it yourself, and then upload your result to the text field on the website and hit submit, then part 2 will appear

rapid wolf
#

nothing checks automatically, you can solve some problems with a calculator

simple raven
polar fractal
#

ah ok thx

#

and its the same for every day?

rapid wolf
#

yes

polar fractal
#

πŸ‘

simple raven
#

yeah you just get one number as the output, the challenge is meant to be solvable with any language so it's flexible like that

long jacinth
#

any brainf*ck enjoyers?

earnest forge
#

No

rapid wolf
#

I dont think AOC is solvable in any existing BF interpreter

earnest forge
#

I mean there are jit/aot compilers

rapid wolf
#

I dont believe they are good enough

earnest forge
#

I remember that one of them literally just compiles it to a state machine in C lol

rapid wolf
#

even if you get their fancy jumps are O(1) rather than O(n), I would be surprised if they could get the same time complexity as a more conventional language.

#

but maybe I am out of date on optimised brainfuck

polar fractal
#

are we allowed to use any external packages like numpy or just builtins?

simple raven
#

you are just asked not to feed the problem into chatgpt

polar fractal
#

got it thx πŸ™‚

#

got the first one πŸ˜„

sleek cave
#

don't tell me the input is literally ||an adjacency list||

hidden musk
#

@cyan sleet on the bright side, no language to install today 😩😩

zenith elbow
#

TIL, bash supports C style for loops (i = initial; i < cond; i += step), and maps!

#

but why is bash so slow even with the ||lcm|| solution

fervent helm
#

but ideally neither would be the case – it would just be a slightly different problem that's the right difficulty without simplification

polar fractal
#

how do i get the advent of code badge/role on this discord like some of you have?

hazy ermine
#

[Day 8]
will it reach the end node only after full repetitions of the direction string or it can reach in, say 2 and a half repetitions?

cyan sleet
#

my solution takes like 2 seconds total

hazy ermine
#

damn

hazy ermine
rocky spire
#

Mine also only had full repeats, so probably not luck but intended

meager ice
#

No, mine reached about one and a half

#

Maybe you just got lucky?

rocky spire
#

Hmmm... My solution 100% would've failed if an endpoint appeared in the middle of the instruction

meager ice
#

I can send you my input of you wanna test

rocky spire
#

sure?

hazy ermine
rocky spire
#

Today's inputs have so many weird assumptions you can make

meager ice
#

i'll check once i get home. I had such a stupid bug and was debugging it for an hour so maybe my brain mixed my memories lol

#

oh yeah nvm. I checked my answer and remember my input instruction string had 263 characters, so dividng answer with 263 gave me whole number. So it seems like it made full repeats

#

But I coded my solution so it works even if it's not a full repeat

hazy ermine
#

wait you solved part 2 as well?

meager ice
#

not yet, had to go to university

#

But I read instructions and it doesn't seem that hard

#

Boy will I probably mess up lmao

rocky spire
#

If you're thinking about simulating then, uh, I'm sorry to inform you that (at least in my input) the answer was 14 digits long

meager ice
#

oh πŸ˜‘

#

then i gotta figure out something else

cyan sleet
#

it's my first time using associative arrays actually

hidden musk
#

I'm very thankful for eval

hidden musk
rocky spire
hazy ermine
#

ah thanks, Go does have 64bit ints

hidden musk
sleek remnant
#

In what range is the answer of part 1? Cause I get like more than ||10k|| and it’s still running and it really feels like I just created an infinite loop

sleek remnant
#

Guess I just gotta wait till I get home, my school Chromebook and online ide is way to slow for that haha

halcyon pulsar
#

Can someone help explain how to do part 2 in a realistic time?

long jacinth
#

||16k|| here

rocky spire
#

Hint: ||The solutions of the individual starts (like what you did in part 1) relates to the whole solution that considers all starts||

long jacinth
#

wdym, P2 is same as part 1, it just takes longer πŸ‘€

ripe meteor
#

Pt2 runs instantly for me

#

139ms for both parts

halcyon pulsar
sleek remnant
lime fulcrum
#

Using a dict?

rocky spire
#

155ms both parts for me

sleek remnant
ripe meteor
#

my pt1 is <20k

#

pt2 is 14 chars long

lime fulcrum
halcyon pulsar
ripe meteor
#

||πŸ‘€||

halcyon pulsar
#

Damn that works

#

Much easier than I thought

rocky spire
#

If you inspect the inputs then you can conclude that it works, which is probably the intended solution
If you only look at what the problem says then not so much, and you would've needed a much more complex solution

sleek remnant
mellow mesa
sleek remnant
#

I used the first to last line, in my input it’s β€˜VTM’ - β€˜JDH’

mellow mesa
sleek remnant
#

Oh I go from AAA to ZZZ in the input as well?

#

Oh yeah that’s it

#

I feel stupid now πŸ˜‚

mellow mesa
sleek remnant
#

Ty!

mellow mesa
# sleek remnant Ty!

I would predict that is the reason your code keeps running without getting to 'ZZZ', I did the same mistake

sleek remnant
#

Yes it was, I got the right answer now

#

Thanks for your help

long jacinth
#

i wonder how many ||loops || there are in the input

#

ive had ||6 starts|| so theres at least that many

jovial imp
#

what is the question

magic oxide
#

||i'm fine with some assumptions since otherwise the problem is not really tractable||

#

||but there were far too many assumptions today for my liking||

ripe meteor
#

No idea what you all mean, just follow the directions πŸ’€

rapid wolf
#

Did you actually ||solve the full problem in the general case? LCM/product of each path is incorrect as per the problem statement||

mellow mesa
rapid wolf
hidden musk
#

||it's not correct to assume there's a cycle||

rapid wolf
hidden musk
#

right, yeah

mellow mesa
#

Sorry for excessive spoilering, rather do too much than too little

hidden musk
#

right. but it just so happens to be that way. it's not guaranteed

mellow mesa
#

Interesting day to say the least

hidden musk
#

i don't really like this problem for that reason, actually. i think that means i agree with stickie

magic oxide
#

damn pub agrees with me?

rapid wolf
hidden musk
#

as a side note, bash functions are πŸ₯΄

minor cave
#

"what did you do for AoC this year?"
"create unspeakable horrors in bash"

hidden musk
#

it's actually not too bad

#

the input was nicely almost valid syntax

#

so i just sedded it then evaled it

hidden musk
magic oxide
hidden musk
#

the bus problem was good

#

a few years ago

low condor
#

that was nice but that was a later puzzle

#

for a day 8 puzzle I think the difficult is ok

magic oxide
#

my opinion is that you shouldn't take a hard problem and adjust the difficulty to fit an easier day by putting in assumptions about the input

#

i would've enjoyed doing this day without the assumptions on a later date

scarlet wasp
#

You don't need to "assume" anything though. Analyze, yes, but that's not a surprising part of problem solving imo

hidden musk
#

sure you're exploiting a pattern you observed, but it's technically incorrect

scarlet wasp
#

Idk, I don't agree that a solution necessarily needs to be able to handle all kinds of input. Story-wise, there's just one input - not multiple - so you'd analyze it and solve the situation accordingly πŸ™‚ But yeah, it's more satisfying to write general solutions

magic oxide
#

by assume I mean anything that isn't there on the problem statement and has to be gleaned from the input
I am somewhat ok with two of the assumptions today, but the third is just

woven sable
#

||i feeel like the fact that u had to derive that it cycles is kinda dumb||

#

nowhere did it say ||it cycles||

rapid wolf
woven sable
#

oh oops sorry

scarlet wasp
magic oxide
#

||you wouldn't, and shouldn't, expect the starting offset to be the same as the cycle length, and it doesn't even make the puzzle that much harder, and it awarded people who incorrectly thought "oh i just need to lcm the starting offset/cycle length" and didn't think about CRT, and checking if starting offset == cycle length is such a weird, unusual thing to do that I don't think it should've been an assumption today||

woven sable
magic oxide
#

||you had to derive that Z cycles, and only one Z per cycle||

rapid wolf
magic oxide
#

||cycles are basically guaranteed by assuming a large enough answer and pigeonhole principle||

scarlet wasp
rapid wolf
#

of course I can, but that doesn't make it interesting. I should not have to double check whether each possible case actually happens in the input.

scarlet wasp
#

shrugs Different perspectives I guess πŸ™‚

woven sable
#

i feel like the most fun problems in past years have been path finding problems like flood fill and all or like

#

snailfish was really fun

#

and day 24 2021

#

the arithmetic one

simple raven
#

@mossy basin your visualisations are amazing, good job! πŸ™‚

magic oxide
#

from the perspective of solving the problem blind, you have no idea which assumptions you should be checking imo

mossy basin
#

thanks

magic oxide
#

for stuff like day 24 of 2021, the assumption is kinda ok, because there isn't much there to do other than analyze the input

#

for today, I would not have batted an eye if we had to solve the general case

#

especially given the difficulty spikes this year

rapid wolf
#

2021d24 also literally tells you to decompile it.

simple raven
magic oxide
#

I did have another gripe with 6 because of the lack of edge case testing for some inputs

#

but that's a separate matter

simple raven
untold briar
#

Or more like day 3 and 5 were way too hard haha

#

You can see from statistics how many ppl dropped the challenge in those days

low condor
#

day 1 3 and 5 were the hardest so far

#

uncharacteristically difficult for those days

#

day 1 is hardest day 1 I've seen for years

simple raven
#

to me day4 was hard as well because I was determined to ||write a recursive solution but I have never practiced recursion||

untold briar
#

Loops are safer, imho

simple raven
#

tbh I couldn't think of how to write the loop solution, ||recursion|| just made sense to me for that problem

untold briar
compact wasp
#

source: i use functional languages

untold briar
#

Idk, I just find recursion very hard to debug

#

The order of what's happening in recursive loops is hard to track for me

low condor
#

It takes me a while to come up with a recursive solution

#

I'm kinda surprised people went for it for day 4

#

I have an iterative solution that looks fairly reasonable

ocean grove
#

Do you get any prizes for doing well in Advent of Code>

minor cave
#

If you get all 50 stars, you get a cute Advent of Code Completionist Role for the month of January

ocean grove
#

alright!

covert arrow
wet yoke
#

Just gotta think of the function as running backwards πŸ™‚

hidden musk
#

it's nice to think inductively. how can i create the n=1 case from the n=2 case, etc

jovial jay
# untold briar I think recursive should be avoided in general

i never had to use recursion. though I use G'MIC as main, and in the math parser, recursion isn't possible most of the time, so I always have to figure out a iterative solution. by then, when I think of solving a problem, I always end up solving it anyway with no recursion.

rapid wolf
#

I use recursion all the time, I find it more convenient then rewriting an already correct function into a loop.

#

my ||range splitting solution|| used recursion, for example.

jovial jay
#

i'm thinking of solving day 5 part 2 by using a while loop to modify dynamic array or list of values, and if the last value of first index reaches the minimal, I then find the minimal values from what point. kind of like modifying all the dynamic array until the last value first index reaches 0.

jovial jay
#

hmm, i need to figure out how to split a range given ranges here. Hmmm, I"ll think about that

dreamy arch
#

One message removed from a suspended account.

low condor
#

I never use recursion unless the solution screams for it, personally

#

Python feels like an iterative-first lang

#

Sometimes recursion is obviously called for though (e.g. parsing recursive structures) and then I will use it

dreamy arch
low condor
#

the answer to my question is clearly no then

jovial jay
low condor
#

there are people better than me (and almost certainly in this channel) to answer this, but I'll have a go

#

Functions that are recursive-first (typically functional languages) have features geared to recursion. The key one that comes to mind is "tail call optimisation"

minor cave
#

Python doesn't have tail recursion, which feels like an easy answer to why it doesn't necessarily handle recursion well. Without using cache I feel like it's easy to run into a RecursionDepth error for any moderately sized problem/input

low condor
#

^

minor cave
#

Then if you want to use cache, you need to make sure you're using inputs that can be hashed. That could result in having to finetune your data structures a bit

low condor
#

I'm probably going to butcher this explanation, but "tail recursion" is where, if the last line of a recursive function is the recursive call, you don't add another stack frame

#

I think

minor cave
#

side eyes dataclasses

low condor
low condor
#

map, filter and reduce were almost not going to be in Python 3, for example

#

(in the end reduce was downgraded out of the std lib built ins to functools)

rapid wolf
#

A valuable aspect that makes recursion significantly easier to think about is functional purity - a functions result only depends on its arguments, and it only returns a result, doesn't modify any global variables etc. At which point, recursion get less "leaky" as an abstraction, and you can mostly just call the same function as you would any other helper function. functional languages tend to make pure functions the default, or the only kind of function.

jovial jay
#

if every 5 days is hard. i bet day 10 is going to be about writing a OS

sleek cave
#

today looks super cool. looked at part 1 and thought it was trivial, given the input is ||an adjacency list|| and all xD
thought maybe part 2 would be ||disregard instructions, find shortest path|| but i was like, "||isn't that a lil too textbook :P||"
and wow does it hit me with a twist! i'm currently thinking ||cycle detection and least common multiple||, but i complete forgot ||how to do the former ... need to brush up on graph theory|| xD

low condor
untold briar
sleek cave
# low condor can't wait to see your solution!

oh man this is harder than i thought
i think i can go for a clunky solution under the ||very jank, yet (at least for me, i have tested) correct assumption that for every starting node, using the instructions to traverse the network will certainly encounter a cycle, during which a single, unique ending node is encountered||

low condor
hidden musk
#

@minor cave what does this mean

sleek cave
#

it feels like cheating, honestly :P

#

what if, in a more robust version of the problem with multiple test cases, ||all ending nodes are reached before any cycle commences? some starting nodes don't fall into a cycle at all? two or more ending nodes are encountered in a cycle?||

#

of course, ||all the above are not true for my puzzle input|| :P

#

but still

low condor
#

It is often the case that the input is crafted specifically with assumptions in mind

#

For better or for worse

sleek cave
#

that's a great point

#

so at the end of the day, we go back to rule #1 of programming

#

if it works, it works

low condor
#

If the day has assumptions then I’ll often write assertions to prove the assumptions hold

sleek cave
#

oh great idea

low condor
#

And document that the solution only works for those assumptions

#

And write unit tests to prove that the exceptions are raised when the assumption breaks

sleek cave
#

kk, i think i'll do just that

#

time to take a break and watch movie today :D

#

will resume with my janky solution tomorrow lol

low condor
#

Jkjk

jovial jay
low condor
#

That’s perfectly fine too :) I’m just going OTT for my solutions

#

Honestly for P2 I did that first before I wrote my test

#

It’s one of the areas where TDD didn’t work so well for me, because you don’t want to write tests just to find that the assumption is trash

wet yoke
#

I did just start incorporating tests early in the day myself. Not so bad when you've got the samples and their answers.

brazen bridge
#

does anyone know some good graph libraries for the usual type of AoC graph problems that will appear in the near future? I'm looking for something that handles DFS BFS and potentially shortest path type stuff?

rocky spire
#

If you mean visualization, then networkx is a popular choice
If you mean one that contains actual implementations of these algos then idk

solid rover
#

I opened up a thread in #1035199133436354600 if anyone already did day 3 and would be willing to guide me in where my current logic has gone wrong

rancid creek
solid rover
rancid creek
#

Ah cool. congrats.

#

After you're done though defintly look at other solutions for new ideas.

earnest forge
#

GLHF everyone!!

minor cave
#

Language Roulette: Day 9
The language is ... Scala

peak dock
shut trellisBOT
magic oxide
#

oh wtf it's time?

flat sequoia
#

3/1

#

lmao

#

nice

magic oxide
#

ooh finite differences

pine tiger
#

today's was underwhelming

#

i mean like that was it?

covert arrow
#

my heat is in 5 minutes πŸ˜”

#

no leaderboard again ig

lusty rover
#

_I still don't even understand the problem and you're done already softFeels _

pine tiger
#

holy crap still in the middle of the second michael buble song

honest nacelle
#

I can't even understand what the question is asking...

hexed axle
#

That leaderboard was nice and fast

earnest forge
#

Spoiler channel?

#

268/133 ._.

#

Made a silly mistake that slowed me way down for p1

minor cave
#

god damn, can't even look away for 10 minutes

pine tiger
#

yeah like

#

you refresh once and the lb is full πŸ’€

mossy basin
#

rank 262 is about the best i can get

#

i'm too slow

hexed axle
#

Right? I was modeling the completion time and went, "That means it should be done by 5 minutes past the hour. What time is it? Oh, it's 6 past the hour let's check the lead--it's full."

minor cave
pine tiger
hexed axle
pine tiger
#

i mean sorry if i'm not reading that message right but it appears you thought it would fill in 5 mins but it filled in 6

modern terrace
#

that was relatively easy

hexed axle
#

No by the time I finished running the model it was already well past when the leaderboard filled

pine tiger
#

oh lmao

minor cave
#

I was genuinely settling in for a 20-30 minute leaderboard fill time

hexed axle
#

right? Awesome that it filled so fast but I've been looking forward to predicting the leaderboard filling up, and it's just been too quick most of the time

minor cave
#

The times to fill each day have been so variable compared to prior years. Difficulty is all over the place

hexed axle
#

It's a weird balance of parsing and math (granted I've only got one star this year so I've been mostly watching comments on it) but it's nifty to see how this year feels different

zinc kindle
#

Yes. Top 1000 for part2.
When doing part1, assumed I'd need to get 100000'th value for each row or something, which would require something more efficient. As such, ||I decided not to bother with the supplied algorithm, switched to python, and used numpy.polynomial to derive the formula, which would give me an easy time in part2||
result: ||I was wrong about what we'd have to do. Still, managed part2 in 30 seconds (would have been less but reran it on sample input after gave suspiciously small answer before submitting||

hexed axle
#

The difference between getting the first star and the second star each day is really wild

flat sequoia
#

Today's is like, the same though

#

And it's interesting that the person who got global 1st on Part 1 didn't even place for Part 2

flat sequoia
peak dock
#

thats sort of what i was expecting too

honest nacelle
#

... huh

#

this means tomorrow is gonna be awful, huh?

untold briar
#

Or it could be easy again, who knows

zinc kindle
#

Weekends (utc-5 time) tend to be harder than weekdays. For people many time zones ahead like myself, that tends to be Sunday and monday.

stable shale
#

Spent 40 minutes debugging the problem only to figure out I didn't handle ||negatives|| in input parsing facepalm

covert arrow
#

I did abs(b-a) instead of b-a while debugging and forgot to remove it

jovial jay
zenith elbow
#

today was probably the most uninteresting part 2

jade atlas
royal gull
untold briar
#

😏

zenith elbow
jade atlas
jade atlas
hexed axle
untold briar
#

Yeah you can use the rest of your time to solve past puzzles or optimize your current ones

untold briar
royal gull
#

Maybe we need a leaderboard for mortals.

rancid creek
#

There are various leaderboards. There's 2 for reddit, 1 for discord I'm on, And another one I think is for streamers or something I'm not sure why I'm on it.

#

I only recognize my name and jp

rancid creek
#

beacons or snail math were both a lot of fun

simple knot
#

does anyone here know any java?

#

i cant do day 7

#

well, im just getting the wrong answer

#

but i really think it should be working

untold briar
simple knot
#

i mean, a lot of people can do two languages, i thought it might be worth asking lol

real quartz
#

Well, dang. Never thought I'd have this much difficultly on the day 1 of the advent puzzle, lol and I'm trying something new I guess to learn, outside of doing my main project that I'm kinda stuck on.

#

Dang, I really should have gone for trying 15 minute projects and slowly build up, rather than just go for major ones but advent of code seems fun

covert arrow
simple knot
#

oh bet

simple knot
covert arrow
real quartz
#

Right now, I'm looking at puzzle input, and I've converted entire thing into a rows of string to be put inside a variable, and I'm working out the best way to pull the numbers from the list of strings and then using sum to get the final number that I can input to get into 2nd day.

#

If my approach is wrong, then sigh, I'll figure out a different way. I'm googling all over the place without using ChatGPT

covert arrow
real quartz
#

Will do after much headscratching and if I can't find a solution.

jade atlas
covert arrow
low condor
#

Just renewed my AoC++ for this year

#

Feels good

magic oxide
#

nice

low condor
#

At some point I need to transfer my account to another one (next year perhaps)

#

my username looks a little silly next to everyone else on my work leaderboard

#

I'm almost certain no one at work authenticated through Reddit lol

#

I'll probably switch to Github

hazy ermine
#

you have a work leaderboard?

low condor
#

yup

#

majority of people have like a proper name, and then there's me with my Reddit account lol

hazy ermine
#

reddit/email usernames are easily in the top regrets of anyone

magic oxide
#

I'm still πŸ₯΄ about using my proper name for stuff online

#

but it'd probably be good for finding work

low condor
#

just show everyone how high up you are on Advent of Code leaderboards

#

instant hire

hazy ermine
#

wait really?

magic oxide
#

if only 450 stars on aoc was enough to get a job

hazy ermine
#

didnt know AoC has employability value

low condor
hazy ermine
#

right

low condor
#

and it helps get practice for actual interviews too

#

you might be asked these kinds of questions

hazy ermine
#

true but everyones grinding away on platforms like leetcode

#

its kinda sad that leetcode type questions have become the standard for interviews, but understandably theres probably no other easy / short / objective method to evalutate candidates

covert arrow
#

I wish I was more interested in leetcode/dsa in general, but tbh I just hate it

hazy ermine
#

dsa is actually interesting, its the grind part that i dont like

covert arrow
#

Yeah I agree, I'm fine with dsa but I'm not really into competitive programming

hazy ermine
#

same

magic oxide
#

I'm somewhat into competitive programming, but that might just be my interest for maths leaking into it

#

I suck at cp anyways so PensiveCat

hazy ermine
#

although i see leetcode like some sort of puzzles to solve just like AoC

low condor
#

I'm not really into competitive programming but I do enjoy AoC

simple raven
#

But aoc is more fun πŸ™‚

hazy ermine
low condor
#

difficulty is nicely scaled and I enjoy the community around it during Xmas

covert arrow
#

yeah I like aoc/codewars style puzzles more

magic oxide
#

I like well made codewars ones

zenith elbow
low condor
#

I get to write my own answer, and then I enjoy code review and debugging other solutions too

hazy ermine
#

havent heard of codewars

#

is it still a thing?

covert arrow
#

Yeah, it's like leetcode but more casual

hazy ermine
#

wow

magic oxide
#

it's a shame I'm always on holiday during december

low condor
magic oxide
#

my family is overseas so I kinda have to
tho this trip is different

zenith elbow
hazy ermine
#

is someone tyring to send code lol

covert arrow
#

Seems like it

magic oxide
#

graduated aus hs, and it's a tradition over here to go on a trip with ur school friends after that

hazy ermine
covert arrow
#

Is this related to Advent of Code?

hollow wharf
#

soru

#

sory

#

new here

low condor
hollow wharf
#

k

covert arrow
low condor
#

!rule 8

marsh currentBOT
#

8. Do not help with ongoing exams. When helping with homework, help people learn how to do the assignment without doing it for them.

simple raven
#

I've just learned about the rule not to share your puzzle input on github, I had to do a quick purge 😰

low condor
simple raven
low condor
#

I forget lol

long jacinth
#

what order are the answers for D7P2?

#

or well, how many digits

low condor
#

then when you install it you do you git filter-repo --invert-paths --path <path to the file or directory>

#

...or if you don't care about history just transfer to a new repo and start again

modern terrace
#

251mil d7p2

#

it's pretty close to p1

simple raven
#

oh day7 sorry

modern terrace
#

perhaps you mean d8 p2 which is a more reasonable day to ask such a question

long jacinth
#

what, my P1 was in tens of thousands

#

no i mean D7

#

wait

#

todays the eight

#

yes, i do mean D8, im sorry

modern terrace
long jacinth
#

ninth*

#

yesterdays, please, lol

simple raven
#

okay so I was right πŸ˜„ part 1 tens of thousands, part 2 tens of trillions

modern terrace
#

aanyway yes d8 is in the tens of trillions for part 2 and tens of thousands for part 1

long jacinth
#

okay, thanks

hazy ermine
#

today was so easy people be discussing about previous days

modern terrace
#

d8 and d5 are probably the hardest of the first 10 days

#

d5 mostly

rapid wolf
#

I still don't know a satisfying solution to d5p2.

modern terrace
#

where's that fancy dot graph

#

ah

hazy ermine
#

they might be onto something... right?

modern terrace
magic oxide
#

calculating intervals is pretty satisfying to me

hazy ermine
modern terrace
#

but that isn't "satisfying" per se, is it?

rapid wolf
#

I meant day 3, oops

hazy ermine
#

apart from bruteforce ofc

magic oxide
#

I think some people also said something about dfs from the back?

rapid wolf
#

Honestly d5p2 felt really easy to me

magic oxide
#

ah

rapid wolf
#

If I knew how to write Multiline functions in APL, I would be done fairly quickly

magic oxide
#

I think the name numbers and combine them -> iterate over gears method was pretty satisfying

modern terrace
#

yeah

hazy ermine
#

from what i've seen, part 2 solution is always a not-so-major change to your part 1 solution if you had chosen the right method from the beginning

rapid wolf
#

That's what I did in Haskell, but it didn't really feel great. I would want a solution that finds them without duplicates in the first place, not one that just removes them.

modern terrace
hazy ermine
#

i anchored around the gears, which made things easy

rapid wolf
#

It wasn't difficult per se, though my code was pretty horrid. Just felt inelegant

modern terrace
long jacinth
#

i feel like im doing AoC wrong

#

i made a grid object which held references to every cell, and part that cell belonged to

hazy ermine
rapid wolf
hazy ermine
#

ah

rapid wolf
#

I kind of want to try doing it with a proper graph kinda thing

hazy ermine
#

I used a 2D array and the entire file for day3 was around 100 lines of Go

rapid wolf
#

oh yeah, I didn't have a lot of code either.

magic oxide
#

I think a neat solution would be systematically 'melting' away numbers and gears as you iterate over gears

#

tho that wouldn't quite work for p2

rapid wolf
#

my idea was to have almost an undirected grid graph, but merge digit nodes into one big number node

#

then both p1 and p2 get trivial

magic oxide
#

I want to try my cursed convolution method for p2 sometime in the future

hazy ermine
#

never thought about convolution

rapid wolf
#

my d5 is almost entirely convolution (though it is like fancy APL convolution, not the basic multiply and sum)

magic oxide
#

there's the neat method with convolution where you preprocess and pack numbers together and then convolve

#

and then there's my method which operates on the array with minimal preprocessing (turn the symbols into numbers, and have a shift of +1 and set empty spaces to 0)

#

but has 12 convolutions and a whole bunch of masks afterwards on the convolved arrays

long jacinth
#

oh, the solution to yesterdays was so much easier

#

than i thought it would be

long jacinth
#

okay, day 9 was super easy, i need to return to day 5 today and possibly finish it

low condor
long jacinth
#

i just need to finish the || range interpolation || algorithm

#

shouldnt be too bad

untold briar
#

Well that algorithm choked 2 hours out of me

low condor
#

took me something like 3-4

untold briar
low condor
#

ditto

untold briar
#

Cause the ranges got splintered more and more after each mapping

magic oxide
#

I had a really fun time doing that day actually

#

it took me like 1-2 hours as well but I really enjoyed it

untold briar
#

But past that and it started to get stale for me

low condor
#

I found it quite fiddle-y which gets annoying after a while

simple raven
#

I figured out the range stuff resonably quickly, but then I ended up adding some of the splits into the wrong list and that sent me on a 6hour-long journey of rewriting everything only to realise I had to change one variable name and I would have been done -.-

magic oxide
low condor
#

apparently not!

flat sequoia
#

Man I still can't believe yesterday was just LCM

#

that was legitimately so dumb

magic oxide
#

agreed

flat sequoia
#

I was spending forever trying to remember how to do CRT before I saw that everyone was already done

#

and then was like oh, what

magic oxide
#

luckily I had spoiled myself by looking at code golf chat earlier that day

#

saw them using lcm

#

and was kinda confused how they did it

eager lake
#

I didn't know that math had an lcm function, so wrote my own broken version -- luckily it worked πŸ˜ƒ

flat sequoia
#

Lol

#

that seems quite nontrivial

#

I guess it's not

#

You can do two numbers at a time I guess

simple raven
#

you write it for 2 numbers and then you map it onto (previous result, next number)

flat sequoia
#

Yeah I thought it was nontrivial for a sec because lcm(a, b, c) != abc/gcd(a, b, c)

eager lake
#

well, i factorized the numbers (poorly) and found the common prime factors

flat sequoia
#

but if you just fold then it's trivial so

#

ah yeah that works

#

well that's just gcd

flat sequoia
jade atlas
#

what does this mean? I can't get 50th star because I didn't solve previous days? Is it usually like this?

flat sequoia
#

Yeah it's always like that

#

Last year I lost a point on Day 25 because I choked and someone clicked the button faster than me

flat sequoia
jade atlas
untold briar
#

Then a couple more mins to solve it since I recycled part 1

#

πŸ€ͺ

low condor
#

There’ll also be code to programmatically retrieve the input and post the answer

hidden musk
#

I mean, these don't really help unless you're actually good at problem solving

low condor
#

Well yes they have that as well :)

simple raven
#

the guy that solved today's questions as 3rd is copy-pasting the input manually πŸ˜„

#

still, solving these in 2 minutes is incomprehensible to me

low condor
simple raven
#

I'm hopping between two laptops while working on the solutions and I want all of my random envs to be able to run the solutions, so I never installed aoc-lube

#

I could just set my stuff up better but πŸ€·β€β™‚οΈ

low condor
#

I don’t use it either tbh

#

I never go for lb anyway since puzzles open at 5am for me

simple raven
#

western europe gang (I guess some of Africa would be the same timezone?)

low condor
#

I prefer to go for most verbose solution instead

zenith elbow
#

for me it's 1pm, you might say it's convenient but actually not really since I might have existing schedules at the time

low condor
low condor
#

But at least you can get started on it quicker after your existing schedules

#

West Europe is one of the worst cos if it’s a weekday then I have to wait all day to complete it, if I don’t want to get up at 5am

zenith elbow
#

kind of reminds me of the last guy from here

low condor
#

I am 100% the guy at the top lol

slate berry
#

Lol today's part 2 was just ||reverse input||

simple raven
#

I'm above the guy on the top 😦

#

that awkward moment when the 200k/year in an eastern european country is in a currency that is 1:30 weaker than euro

leaden tartan
#

Ive completed the first 4 days, but got busy with work so havent done the rest. How brutal are the next 5

simple raven
simple raven
modern terrace
#

the only changes are that i use notepad and print() instead of a full IDE and a debugger

low condor
modern terrace
#

and terminal

leaden tartan
low condor
#

But it might be good to use VS Code or PyCharm (or another editor of your choice) and use a debugger for that

modern terrace
#

print() usually works well enough

low condor
#

You do you, but debuggers are amazing

#

Don’t know how I lived without them

#

It’s basically print without actually having to type print all the time

modern terrace
#

i know

#

but i had a problem with speed in the IDE i used

#

in another different language

#

doing a different thing

simple raven
royal gull
low condor
#

Personally I use PyCharm which has that all set up though

shut yarrow
simple raven
#

ah I see, I have to set it up somehow...

#

my friend likes pycharm, I should probably switch but I already got used to vscode

shut yarrow
low condor
low condor
shut yarrow
#

the debugger just wont work

low condor
low condor
simple raven
#

well I'm off to work for an hour in the middle of a storm... it's not like I needed a weekend to rest or anything

simple raven
hazy ermine
#

i totally forgot

#

it didn't cross my mind at all

hidden musk
#

banned

hazy ermine
#

nooooooooooo

austere basin
#

yo guys, rlly quick question - how do i increment a global scope total variable from inside a function?

hazy ermine
#

you declare total as global

austere basin
#

OMG YEAH TY

hazy ermine
#

like so:

total = 0
def some_func():
  global total
  total = 1
modern terrace
simple raven
#

Global total

austere basin
#

YES THANKS GUYS

hazy ermine
#

is it that bad πŸ’€

low condor
#

It’s a gratuitous global so yes !

fleet fox
#

what happens if i share it

#

πŸ’€

low condor
fleet fox
#

oh damn πŸ’€

#

time to purge then...

low condor
#

Multiple inputs is one way he prevents people ripping off his content

fleet fox
#

where did u find it

low condor
#

Can I copy/redistribute part of Advent of Code? Please don't. Advent of Code is free to use, not free to copy. If you're posting a code repository somewhere, please don't include parts of Advent of Code like the puzzle text or your inputs. If you're making a website, please don't make it look like Advent of Code or name it something similar.

fleet fox
#

thanks