#advent-of-code
1 messages ยท Page 18 of 1
They are from your input?
no but they are from the puzzle text
the example they give
im putting it in my code lol
Hmm ๐ค none of my unit tests would be acceptable if we couldnโt do that
i believe so since its the same for everyone
and its publicly available on the website anyway
but not sure
hmmmm
so far, what's been the hardest day?
day5 probably
Deffo Day 5 P2 but Day 1 P2 and Day 3 get honourable mentions
Day 1 P2 annoyed me the most lol
i feel that there hasn't been an increase in difficulty from day 1 to day 9
day 8 p2 annoyed me the most, day 1 p2 took me the longest relative to how difficult it was, day 5 p2 took me the longest period
it hasn't really been linear
Eric deliberately doesnโt make it exactly linear, but even so this year has been a rollercoaster
i genuinely gave up on doing day 5 part 2 efficiently
yeah
weekend puzzle tomorrow 
The language challenge has been fun - not because Iโve done it but because itโs been entertaining to watch from the sidelines
you know what would be an added challenge for the roulette?
no docs
or stackoverflow
or anything
u have to figure out how the language works just by running it
come on that would mean we wont be learning anything
i would lose it
i would think you'd learn a lot simply because you're forced to to solve the problem
true but there should also be enough time
since doing it like that takes a lot longer
Day 8 p2 I solved accidentally quickly with my reading incomprehension.
What happened was: ||On first read, I assumed it looped back to the start after reaching the finish, making the LCM solution obvious||
today is kind of hard
that's messed up
that's actually wouldn't be fun though
if you just go in without knowing anything then you just have to guess at everything
same, half an hour later I was like "wait, that shouldn't have worked"
yeah on second thought i agree
but
but the input just happens to be such that you don't need the fully correct solution
if you had some prior experience with the language
you would need a lot of experience to do it without docs
like, python or rust, i could probably do. not a random language
well i guess it depends how much "prior" is
like, i had used vb, ocaml, and haskell
but i was still dying ๐ฉ
The repo stats are gonna look real cute though!
yeah it's quite colorful
dang that purple one
Waiting for my sql day.
๐
I donโt do this fwiw
I have code to programmatically retrieve the input but thatโs basically it
And a thin wrapper that just opens the right files
And I only started auto fetching input halfway thru last year
I saw you got first today right? congratz
Yeah that was crazy!!
just had a look at your solution, amazing you managed to write that in 1:28 ๐
I think itโs a combination of problem solving experience (quick thinking and adapting existing patterns youโve seen) and knowing the language super well
not at all surprised that p2 took you 20s ๐
Yeah I read p2 and was like thatโs it?
Almost didnโt believe my reading comprehension
Idk personally having a library doesnโt seem that helpful to me, though maybe some parsing helpers would be beneficial
But I feel like the times when parsing is annoying is when the format is really weird and idk if your library would work anyway
Also wow Iโm like barely ahead of this Kevin guy
Sold too hard on day 8 I guess
oh god turns out i've been doing aoc all wrong ๐ญ
dw as soon as problems become nontrivial i'll drop to like 9th or something
Honestly like same
I always troll on those like do a MAX instead of MIN ahem
I need to slow down a bit sometimes
my brother in christ you've been #1 every goddamned time
Looks like I'll have to remove the inputs file. ๐ฆ
but, does this mean I can import from URL instead?
i just gitignored the file
ok, looks like i can use URL instead
at least you'll learn about the reflog now ๐
i think that's fine. you can see those without logging in anyway
and i haven't seen anything saying otherwise
well technically we are not allowed to copy any text at all from the assignments, but I wouldn't expect there to be much issues with copying the tests
o rly?
that's why i'm changing my code to load from URL instead.
i mean then you have to do the login and everything i presume
which i have no idea how to do lmao
no you don't. importing from URL works without login
don't you need to be logged in to access inputs though
you can copy URL when logged in, and then paste it into your code to load from there
you need your session token
you could just scavenge the request from aoc-lube
response = requests.get(
url=URL.format(year=year, day=day) + "/input",
headers=HEADERS,
cookies=TOKEN,
)
whatโs headers and token
token is your session token. If you log into AoC and check your browser storage/cookies, you should see something like session. A long string of alphanumeric. You need that
HTTP headers, I don't know how website stuff works https://requests.readthedocs.io/en/latest/api/
and token your user token
for our leaderboard feature in Sir Robin, it looks something like this:
url = "https://adventofcode.com/{year}/leaderboard/private/view/{leaderboard_id}.json"
AOC_REQUEST_HEADER = {"user-agent": "PythonDiscord AoC Event Bot"}
cookies = ... # we read this in from our envars, but it's the AoC session cookie for my account
async with aiohttp.request("GET", url, headers=AOC_REQUEST_HEADER, cookies=cookies) as resp:
... # do whatever we need with the leaderboard results
That feeling when you finish day 9 part 1 right before heading out for a social function and I just can't physically do part 2 yet. ๐ฎโ๐จ
At least you finished
Imagine being really close but not able to finish part 1 before going out
๐
Saturdays do be like that
programming problems like aoc have actually rewired my brain
my first thought upon grabbing this box of milk was "oh hey, that's a tiling, i wonder how many ways you can tile an m by n rectangle with 1 x 3 and 3 x 1 tiles"
and now i'm actually intrigued
because ik tilings of 2 by n using 1 x 2 and 2 x 1 can be solved using dp
but that's a wayyyy simpler problem
Tile bad, wood floorboards is where its at
how did you guys write your cycle detection algorithm in yesterdays part 2?
due to the graph not having to be a functional once, my goto choice wont work
and a "subcycle" could be repeated multiple times in once cycle
I don't know how big of a spoiler you want but ||the input is special making the task much easier than you (and originally I) think||
oh
oh
||input has the same amount of strings ending on Z as strings ending on A||
yup, that's the first hint
||does the solution involve the chinese remainder theorem||
afaik you should be able to solve it with that, want another hint?
the nearest Z nodes is different for every A node
but im not sure if that matters
im trying to think of an input where the optimal result wont have the nearest z node for each a node
but if it doesn tmatter
found the solution
idk why
||lcm of nearest distances||
idk how id prove it
found it randomly
i dont understand my solution
oh boi you're in for a rollercoaster of comments if you go to either the solutions channel or reddit ๐
oh what do you mean?
are there a lot of people who dont understand it
the input ||was specially designed to allow for your solution||
||you need to make like 5 or 6 assumptions for it to work||
oh tbh i dont like that
not a bad problem
but
i dontr like problems like that
they couldve said that in the description of the problem
this is why it works #1182550042091991180 message
Am I wierd for not liking yesterday for giving too few hints / and not liking today for basically giving us the solution.
cause when i try solving problems like this, i try to design some algorithm such that every input complying wit hsome set of constraints would work on it
honestly i would've liked today and day 5 to be flipped
making puzzles is hard ๐คทโโ๏ธ
Yeye ofc, I love aoc either way, just when I think about it
but if you ignore that not telling us input constraints part, then it was one of the best problems so far this december
This is also a closed off discussion forum, wouldn't really voice this on reddit or something
why?
Just doesn't see it being necessary, especially when this is something we do for fun and the author has the heart in the right place
Just would have been nice to find the extrapolation part for today on my own (if I would have gotten to it)
yea i just sometimes would like to know if the input numbers are all <2^31
so I've put together a difficulty chart for advent of code based on recent years, and aligned it by weekday. There doesn't appear to be a "weekends are harder" trend as much as a "later in the month" harder trend.
in my mind 1 is medium and 7 and 4 are switched, but that doesn't change much
oml 2019 was brutal ๐
for difficulty I used "time to complete part 2 by the last person on the top 100 leaderboard. It's not perfect, but it gives some idea of scale.
wait til you see 2018...
I'm glad they are making AoC more mainstream over the years ๐
I think the skill of participant also increased over time, so that might be reflected in there as well, and why I'm not going back to the first 3 years.
some of those extremes were 2 hour + solves by the top 100 peeps.
normalizing hardness per year might make sense
less people competed back then
whats advent of code?
like, divide all gold times by the longest gold time that year
I remember 2020. Only one "extreme" puzzle and it wasn't even that difficult, it just involved a lot of "legwork"
probably a good idea.
but I'm done for now.
coding challenge https://adventofcode.com/2023
2020 day 20?
yup - the seamonster one
alr probably too hard for me then rn
u wot
average time on leaderboard or time for first solution?
position #100 for part 2
ah
I don't recall it being that hard
yup - agreed. Not difficult, but it takes legwork
first person to finish was at 25 minutes, the leaderboard filled at 1 hour 15 minutes
fun with google sheets

Why not red for insnae?
I added in insane as an after thought, and it only really applies to the older years.
chart inspired by : https://www.maurits.vdschee.nl/scatterplot/
was 2019 2nd insane space cards?
but isnt that due to less people participating?
or not mainly due to the problems difficulty
Love this
(as I've said before)
10007 is a prime number
idk if it matters
why are there so many numbers of the form 100.0007 which are primes
1e9 + 7 is also one
17 is one
it kinda does
107 is one
||17||
oh nvm 1007 isnt and 100007 also isnt
Do you think the problems got eaiser or the people got better?
mostly just more people
and same size leaderboard
Probably a little of both.
omg how do you even approach writing code for that?
I assume the problem essentially asks you to create some sort of hyper-optimised look-up table?
it comes down to some number theory, operations modulo a prime
basically, after you figure out what one shuffle does you can extrapolate quickly
is it similar to the ranges question couple days ago? ||instead of simulating individual cards you suffle around ranges of numbers?||
do you know the matrix power approach for computing fibonacci numbers?
not quite
nah, my background is in physics and even then I struggled with math ๐ฆ
basically when you have one shuffle figured out you can solve the thing in roughly log(that big number) time
oh that's pretty good wow
so the fib matrix thing boils down to this matrix on the left describing one step of fibonacci
[0 1] [a] = [ b ]
[1 1] [b] [a+b]
makes sense
in general if you mult by that matrix n times you take n steps
lin alg
i hate it
i dont want to know the context
but how quickly can we do that?
this is a cool thing though
stuff involving lin alg cant be cool
computing the nth fibonnacci number in O(log n) time
I like lin alg, it's like watching a magic trick I don't understand but it's cool to see how it's done
(ignoring the raw cost of large integer operations...)
so the trick is this, say we wanted to do n=85
its so imporatant
important
left side matrix to the nth power?
expressed in powers of two: 85 = 64 + 16 + 4 + 1
we can compute powers of two pf a matrix easily by just squaring the matrix
yeah
hey could someone possibly give me a pointer on day7?
do you then do
[0 1]^n [a] = [ Fn ]
[1 1] [b] [ Fn+1]
``` ?
hand_rank={'A':14, 'K':13, 'Q':12, 'J':11, 'T':10, '9':9, '8':8, '7':7, '6':6, '5':5, '4':4, '3':3, '2':2}
dict={'Five of a Kind':[],
'Four of a Kind':[],
'Full House':[],
'Three of a Kind':[],
'Two Pair':[],
'One Pair':[],
'High Card':[]}
with open('Day 7\input.txt','r') as file:
lines=file.readlines()
for i in lines:
hand,bid=i.strip().split()
dict_temp={}
for c in hand:
if c not in dict_temp:
dict_temp[c]=1
else:
dict_temp[c]+=1
# classify the hand
if 5 in dict_temp.values():
dict['Five of a Kind'].append(hand)
elif 4 in dict_temp.values():
dict['Four of a Kind'].append(hand)
elif 3 in dict_temp.values() and 2 in dict_temp.values():
dict['Full House'].append(hand)
elif 3 in dict_temp.values() :
dict['Three of a Kind'].append(hand)
elif list(dict_temp.values()).count(2)==2:
dict['Two Pair'].append(hand)
elif 2 in dict_temp.values() :
dict['One Pair'].append(hand)
else:
dict['High Card'].append(hand)
print(dict)
for i in dict.items```
im kinda stuck here because i now need to literally sort through the hands with the strongest first. Is this the way for a noob/intermediate to go about it ?
(sorry for the massive wall)
if you want me to delete i can
let a=b=1 or whatever your starting values are
and yeah
this is pretty much how I coded it, then to sort the hands I did sorted(hand, key=self.translate) where self.translate is a method that turns the hand's cards into its values use a dict similar to your hand_rank
[0 1]^n [1] = [ Fn ]
[1 1] [1] [ Fn+1]
``` so this is how I get fibonnaci numbers super quick? how does that relate to the solution of day22
so if its AAAAA, its value is [14,14,14,14,14]
yeah
you can express the effects of a shuffle on the card you're tracking as a matrix
yeah, in a dict just like you, then sorted the lists within each category
like this
ok
ok let me see
thanks boss
O.o huh
you made me think of my solution
so instead of tracking the whole deck you just track where the one card 2019 goes?
and i noticed that i compute the type of your hand way too often
up to n times for each hand
cause i didnt save the type and just called a function to compute it in my custom comparator function
wait
are we talking about this years blackjack problem
poker but yeah ๐ Camel Cards
poker
yea
poker
what was i thinking ๐ญ
blacjack doesnt have hands
like these
basically yeah
question
when you iterate through your dictionary of all your hands
are you doing outside of the main loop ?
I did this too - gotta fix this in my code :)
main loop being the one where each line / hand is being evaluated and classified
it doesnt make sense to do it there cuz much easier to sort at the end right
when all the ahnds are categorised
I'm looking at a solution in python and it's incredible that people figured this out. In this solution https://github.com/mcpower/adventofcode/blob/501b66084b0060e0375fc3d78460fb549bc7dfab/2019/22/a-improved.py what is repeats? I assume cards is the new input but I don't have access to the problem assignment
i wont
ah, let me share the relevant part
the input size is tiny so we can afford to loop several times and do everything properly, so I have one for loop that sorts hands into ranks, second that translates each hand into numbers as we talked about earlier, third that firstly sorts the hands within-rank and then puts them into one final list in the correct order
oh lol
it's log of that second number
I would love to see a reddit post "so I'm going to let my bruteforce algorithm run, see you at the heat-death of the universe"
that first number you just need to be clever about, you can't just simulate the full deck like in part 1
makes sense - only bring a small performance benefit anyway
but you can still compute the effects of the shuffle
my code drops from 0.2 to 0.02 secs
that is a big difference
I liked my approach to the poker problem
I don't even remember what I was doing back then, but looking at my code I saw this part:
o *= inv(1-i); i = pow(i, n, c)
return (p*i + (1-i)*o) % c
which managed to get the right answer.
compute 5 counts, and then stuff that and info about the hand into an integer
and sort by that integer
yeah but not in absolute terms
I do a bunch of sorting and appending to lists etc and it runs in 4ms
2019/22 ?
day7 part2 2023 ๐
ah !
I couldn't even sort a list in python in 2019 ๐
I guess in python you can just do a tuple/list, i.e. 5T552 would be [3, 1, 1, 0, 0, 5, 10, 5, 5, 2]
if you're curious this was my finished solution for 2019/22:
def solve(c, n, p, o=0, i=1):
inv = lambda x: pow(x, c-2, c)
for s in [row.split() for row in orders.splitlines() if row]:
if s[0] == 'cut': o += i * int(s[-1])
if s[1] == 'with': i *= inv(int(s[-1]))
if s[1] == 'into': o -= i; i *= -1
o *= inv(1-i); i = pow(i, n, c)
return (p*i + (1-i)*o) % c
for x in [(10007,10005,2019), (119315717514047,101741582076661,2020)]:
print(solve(*x))
my initial part 1 was more brute force.
I now kinda see what you're doing but honestly even if I wrote that code and it gave me the right answer I wouldn't trust it ๐ looks too esoteric
but gj on getting it done ๐
yeah, you need to realize the shuffle operations end up being simple operations when modulo a prime
number of lines ~10. time to complete listed at 15 hours rank #1200
that last for loop was unnecessary
imo
but my code isnt good either
the for loop is just part 1 and part 2, why unnecessary?
print(solve(*tuple1)); print(solve(*tuple2))```
which last for loop? the one over the input file, or the one that was part1/part2 ?
I think I was in the US on a business trip end of 2019, do I couldn't have done it quickly even if I wanted to ๐
part2 took me an hour, and part 1 took 14 hours, makes me think I went to bed and did it the next day.
I actually think my part 7 is okay ish. one is clean enough. two might need some comments
I think that was my first year using python so it was pretty sketchy code. ๐
speaking of sketchy code
this year is quite sketchy code with the language roulette ๐
I used the same code for parts 1 and 2, the only change I did was to the input file for part 2 I substituted the Jacks for Wilds.
open(aocinput).read().replace('J','W')
err...long ago
nice!
but nov/dec dont count because i was doing a sql bootcamp in person
it should be much more active hah
that does seem to be more reasonable
I did project euler stuff back in like...2009?
jeez
ur ancient
one thing about dev community
is how supportive everyone is
2009 = ancient. ๐
if "J" in hand:
res = []
jlist = [[] for _ in range(7)]
for i in range(12):
handtest = line[0].replace("J",cards[i+1])
jlist[handvalue(handtest)].append([cardsortvalue(handtest,value),handtest])
for categories in jlist:
res.extend(sorted(categories))
handtest = res[-1][1]
group = handvalue(handtest)``` just not that clean
I did my first programming competition in like 2001 probably
I guess I'm pre ancient
Primordial?
xelf was one of the first prototypes, he's kept up fine with the years with only minor maintenance
wow you're old
I first met python when I did physics master's around 5 years ago, but the course was so dense I didn't learn anything, but I really started learning python during covid and been coding since, just not CS stuff as much as other people here
im big in crypto
and
getting better there means knowing how to code
so here i am
I started around Covid as well ๐
i started in jun-23, dabbled start of the year w/ web3 but im not gonna count that
really really late
I got a kid as old as advent of code and t shirts older than 80 percent of participants ๐
bit sad
I got to level 60 in wow for the first time and learned python, one has been a little more useful than the other ๐
damn! yall giving imposter syndrome to me
hah
i feel like i peaked in covid coding wise tho
covid rly got a bunch of ppl in
i think i know a lot more langs now but idt i'll ever be as good as python as i was in 2021
I had to learn to code during covid for my phd
i j don't understand internals like i used to
sheesh
ok yall distracting me need to finish day 7 aaaa
really coding? august. except if we count sps programming
my dad would hoard old computers and stuff, I dug one out and got it running, and that was my first real introduction to computer related stuff
I built my first computer with my dad 1991
tbf a lot of what I learned since then is not necessarily being better at python, but just understanding how computers work and being generally more comfortable with new languages so I can solve basic problems like change bits for a website or use a simplified version of javascript to do something, which I wouldn't have been able back when all I knew was python
i have like another really big side hobby and i got into programming by figuring out that i could do a lot of cool stuff with programming so i started coding and then i got really into it
i had like a new project every week
my country didn't exist the way it does today in 1991 ๐
yeahh ig that's true
Montnegro?
Slovakia
Ah I was relatively close
JeremyJoe is surely the most American name a Slovakian ever had
I think that's the most valuable
that's true
like i was horrible at learning new languages like one or two years ago and a few motnhs ago i j found kotlin and picked it up pretty fast
almost as if my 12y/o self picked it as alias ๐
Kotlin is sweet
i love it
only thing i don't like is the stdlib is pretty lacking
the json parsing is a pain
and there's no || lcm function so i had to search up an lcm calculator online for day 7 part 2 because i didn't want to put in the effort in creating one myself ||
that's a pretty useless gripe tho
overall it's amazing, esp the predicate functions
i was doing aoc in kotlin that day
oh right, czechoslovakia
ah, I missed that part!
Why would json parsing be a pain
that's...just outside my lifetime
they are pretty ease. implement euclidean algorithm
if you can compute gcd you can compute lcm
same
alive before javascript is dope. do you remember gopher quicknir? if the web wasnt a thing advent of code would still work, we can have plaintext problems in gopher and live leaderboards through telnet or ssh
idk there's not any stdlib support
which kind of annoys me
I do not remember gopher
I remember pre Internet days though
Like I remember when people started talking about it but all you could do was like log into certain libraries
No world wide web yet maybe
starting day 9!
first thoughts give me ||coefficient solving|| but i don't wanna figure out ||solving a system of linear equations|| (i think it has something to do with ||linear algebra|| but i don't know ||linalg|| at all ๐)
so i might just ||naively simulate for part one||
ahh thats cool
back when internet and www was pretty distinct things
you dont need equations but it might be faster or look better
they still are technically, just that most nontechnical people interchange the two due to the web being so mainstream
lmao nevermind today was a breather ๐
now i really want to do a ||linear algebra|| solution for fun
could anyone assist me with day 7?
i have an answer but its saying its too low
for some reason..
happy to share code
it works on the test case
Will ping in #aoc-solution-hints
did you try the any of the alternate tests?
I solved in #aoc-solution-hints
But still not sure why original solution doesnโt work
I thought my approach of getting the (length of the lists from inferior categories + index of hand +1 )should work but it weirdly doesnโt
I'm not even sure what that is. ๐ But congratulations on getting it done!
Going through old problems and wow, 2018 day 23 part2 was a nightmare to solve. 3d geometry is a pain, tried a solution based on ||overlapping irregular octahedra||, tried to write a 2d solution before extending it to 3d, couldn't. Gave up.
Tried a simple algorithm, gave wrong answer on sample inputs (or maybe I implemented it wrong).
Eventually I just went and ||wrote an algorithm to find a local maxima given a point, used rng to find a bunch of possible start points, and kept running until it seemed like it'd found the best solution. And that finally worked||
Holy hell. I'm still stuck on Day 1. It's making me think that I need to get more experience in older AoC before I even attempt 2023's version
Whoever told me that the difficulty was all over the place wasn't kidding
day 1 is unusually hard this year yeah
day 1 was harder than other day 1s, but in the scheme of things it wasn't a harder aoc puzzle,.
I'll be honest I don't remember how I originally solved that puzzle but apparently ||Z3 has an Optimize class that can solve it fairly easily||
||overlapping irregular octahedra||
what in the actual world
hmm, I'll keep trying
They aren't ||irregular||, idk why Matt said they are (it's ||3d Manhattan distance radius||)
The best thing is to just keep at it, if you get stuck ask for help and keep moving forward while you're learning.
only stop once you feel like you're getting nothing out of it.
Also it's fine to skip days!
^^ maybe start with like day 6 or something
day 1 wasn't so hard that it's a skip day. day 5 could be a skip day.
(yeah, but the easiest way to get someone to feel like they're having fun is to start them with an easy one :P)
Might as well, lol. Thanks guys.
I'm proud of solving Day 5 Part 2 and with a optimized solution too. So happy.
Noice!
What's the optimisation?
Presumably it's the ||interval arithmetic|| one (but maybe there's another better optimisation I hadn't thought of)
wrap it with spoilers please! #1181459209422917683 message
๐ I was reading
i moved it
The initial shapes are regular, but the overlaps would be irregular I think. In retrospect, those could be split into regular shapes maybe I guess?
Ohh, I see what you mean although it isn't what you said
You meant ||irregular overlaps of octahedra||
GLHF everyone
Language Roulette: Day 10
The language is ... Fortran
I JUST REALIZED
AOC 23 LORE IS A CALL STACK
<@&518565788744024082> Good morning! Day 10 is ready to be attempted. View it online now at https://adventofcode.com/2023/day/10. Good luck!
midnight keeps sneaking up on me and then I see BillyBobby talk about it in pygen and scramble

p1 seems all right
time to sleep on it and dream of grayscale wastelands where my sole company scurries away in forsaken labyrinths of black and rust
๐
Day 10 looks pretty bad
WTF is part 2
here, i feel like i still need to grasp day 10 before attempting.
it took me a while to grasp day 5
now we're talking
let's spoiler solutions in this channel please
mb
no solutions thread ๐
my p2 works for example but not actual ๐ญ
LMAO SO CLOSE
i almost gave up because i thought i was too slow. but still lb. ๐ฅณ
Woooo finally a fun problem
I think I would have done pretty well if I didn't have to wait 5 minutes on part 1
But I mixed up | and - by accident
๐
๐
looks like we got a hard one today aye?
38m was enough for 124th so I'mma go with yes
mmm i think i can do this but its going to be wildly innefficient
I swear the hardest part for me was figuring out which direction the S went
I should have just looked at the input and hard coded LMAO
i'm still stuck on part 1 wtf
help i keep getting an answer too high on part 2
i keep getting the same answer every time i make it too though
In this day and age, why donโt we have ascii art?
...we do?
I mean, for aoc problems. F 7 J? My eyes hurt
Oh you mean you wanted unicode box drawing characters?
Yah
that's not ascii
. Its 2am and my eyes are blurry ๐
((and I think Eric wants to keep inputs as valid ascii which seems fair so as to not unnecessarily preclude the use of C))
owie my brain hurts
How to install discord components?
Part 2 sure is fun
Though it's a bit hard haha
I have no idea how to check if a pixel is within a contour and had to consult google though
hey guys, i coded a solution for today part 1 which works for test input but it reaches the maximum recursion limit (around 1182 i think?). is there any way to get around this or do i just have to stop using functions??
Use while loop and flags instead
use sys.setrecursionlimit(...) to change the max depth
The max you can set this limit to is a 32bit int, though it's hopefully enough
Python is not built to withstand big recursive loops
Or what purply suggested, yeah
right... it's fine guys it's not difficult at all to modify it to stop being recursive
||also... just curious from looking at the animations, is part 2 the number of squares contained within the loop?||
cuz if so that will be fun :)
||Yes it is||
Also, remember to add spoiler
Select the text and click the eye button
|| spoiler ||
Or add || at both ends
ok done
roughly what ballpark was your answer in?
cuz idk if i need to optimise
ah nvm got it!
sry guys another quick question - does the maze have any touching corners that would shut off enclosed sections to each other?
basically what i'm asking is - are all the enclosed squares touching each other?
because if so i can just bfs from a square i know is definitely within the maze
||very much no, IIRC||
throwback ๐. maybe you can judge our code today ๐ฅบ
today was fun
You could see from the examples that this is clearly not the case
But well, I couldnt think of an algorithm either and had to google haha
Algorithm hint: ||Lets say you are trying to determine if a certain point A is within the loop or not. If you draw a line from point A to the edge of the map, it may cut the boundaries once right?||
Hint (continue): ||It also may cut the boundaries more than once, but what are those numbers? Do they have something in common?||
Haven't looked at the spoilers but I'm thinking of just bfsing from each point
is the pipe structure symmetrical distance-wise?
day10 I have finally met an unsurmountable challenge ๐ I've spent 2 hours buildings classes to solve part1 but I have no idea how to approach part2. Maybe later.
Or you can click on my spoilers
I found that algorithm online too, not that I thought of it myself
We are dumb so we need to stand on the shoulders of giants
I will have to completely rewrite my solution ๐ฆ in hints someone talked about ||the boundary rules|| so I might try to implement that, I'm just sad I cannot use anything from part1
Yeah there should be many ways to solve this problem
Do not limit yourself to anything
my part1 was just ||1. make Maze class, 2. make Animal class, 3. let animal run through the maze||
So far I've seen 3 approaches for part 2:
- ||go line by line and track how many times you've crossed the path to see if gaps are inside the loop||
- ||floodfill with a scaled up version of the grid so there are gaps between walls for the fill to go through||
- ||floodfill from all points on one side of the loop (relative to direction of travel) since the inside will always be on one side if you traverse in 1 direction||
part one should be doable?
my idea ||make a grid. get form of s. follow orders by checking which one i was last and not going there. until back at the start.||
this is not hints/spoilers channel ๐
Opps
i mean if that is a spoiler then you have bigger problems
But then what are we supposed to discuss here
here, grab some of these |
you can discuss just put solution/hints into spoilers
that's sort-of what I did
you can't spoiler some puzzle inputs actually, since discord doesn't like || inside codeblocks
but you can put it outside the codeblock
this is what happens
for the first option: ||I thought we would have to check both row and column starting from each dirt block, is that not the case? how come we can just do line by line?||
oh that makes sense for today
solution: replace all | with I
||At the start of the line, you'll be outside of the loop. You can still determine how many times you cross the loop with just that line|| (|||, FJ and L7 will result in crossing once||)
Well that's what I did. Also, ||the 'lines' aren't required to be horizontal||
||Though things get complicated if you go through an edge||
I haven't tried implementing it myself though, I used the third option
For example, like this
Those edges coud well, really mess things up
So I did a little twist on the lines
Btw did anyone got 2 loops like this? I think probably not, but just want to ask.
nope
wouldn't that break the starting condition?
oooooohhh hooold on, ||Can I just use my part1 to run the animal around the loop, turn all dots on, let's say the right side of the animal into O, then once the animal is done running, scan for all O's and turn all neighbouring dots into O's until I run out of O's?||
because you can't determine what s is?
yeah it would
..|...
--J...
...F--
...|..
is the top right region connected to the bottom left region?
I believe it is
Yeah that would work
Yes
..|...
--J...
..F---
..|...
how about this?
also yes
damn I don't think I have time to solve this today :/
both are just an extension of this case: ```
..........
.S------7.
.|F----7|.
.||OOOO||.
.||OOOO||.
.|L-7F-J|.
.|II||II|.
.L--JL--J.
..........
same
oh wait I think I misunderstood the problem
what's the inside bit of
F------7
|......|
|.F--7.|
|.|..|.|
|.L--J.|
|......|
L------J
```?
ah wait nvm that can't happen
I see now
good ol Jordan curve theorem
fortran is dumb as hell ngl
I feel like there's a slightly clever solution here ||using pick's theorem||, but I'm too tired to figure that out
yesterday might have been the last roulette day ๐ฅด
stop guilt tripping me ๐ โ
have been trying to figure out how to read all the input into an array for the past 2 hours
lol I made a mistake and accidentally filled in all of the correct I's ๐
i had to take a break for celebrations so i'm gonna continue from day 7 today or tommorow ๐ฆ gotta catch up
Same. Day 5...
Today is the most I've written for a solution in quite a while
whole solution is on the Day 10 spoilers channel if anyone cares to look :)
why do you have to?
if other people can solve this, i can
im not mentally challenged
and i want 50 stars this year

Just so you know, it's ok not to be able to, or not to want to, solve any particular puzzle
I'm a programmer for a living and some of the puzzles in previous years have really thrown me for a loop
oh its a 140x140 matrix
||what if i just floodfill for each tile if i can reach a border without crossing a pipe belonging to the main circle||
would prolly be a naive solution
but a solution
||obviously not floddfilling each tile||
how did i not discover this earlier.
||if a tile can reach a border, then every tile which can be reached from it can also reach the border||
I have a reply to this but will do so in the hints channel
||You can totally floodfill, but you need to add a little twist to it.||
Lets continue in aoc-solution-hints channel
how do you folks do the spoiler things?
||spoiler text goes here||
Could you delete this or edit to spoiler ? Itโs just a bit of a hint.
deleted it sorry
Also you can try googling. Knowing which key word to put into google is also a good skill for a programmer I think.
I always try to google things myself first before asking for help.
We don't have that kind of requirement and it's fine to ask that kind of thing for small stuff. Especially because it's relevant in this channel
Ah I'm not repremanding him or anything, it's just a friendly advice
Since there will be times when you wont be able to ask for help
I know about Google things before asking. Just that I didn't felt like opening a browser, then searching at the time
so somehow I started on 2015 AOC.. and completed 3 days lol
that "weather machine" link was confusing and took me back in time lol
time to start over on 2023 Day 1
you'll start regretting it on day 5, guaranteed
lol is it more difficult than 2015?
never tried AOC before. I only started this month because I can grasp it now
ah okay, yeah some of them seem like they would take me more than a day to do, but I did 3 days last night in 2015, so the beginning ones aren't so hard
Tbh day 5 part 2 has been the hardest challenge so far
Imo atleast
I havent done today yet
I liked day 10 a lot
It looks fun and quite a challenge i wonder what part 2 is but im not gonna spoil myself
Il maybe do a bit of part 10 before i go to bed tonight otherwise i will try to do day 10 and 11 tommorow
I still need to find a day where i have alot of time for day 5 part 2
Many here agreed that the difficulty is all over the place this year
It really is
So you could skip a day and turn back to it later
I did not know you could skip, thats good. This is my first year doing aoc, mostly my first week interacting with this server
You could do it in any order you want
Day 5 broke my streak
You can also wait until the last day and do it starting from day 25
ahh, the reverse tree trimmer. classic
I heard you get hired automatically at any job you want if you do that
(in santa's workshop)
you could be santa
Day 26 challenge: write a program that can solve all previous 25 challenges
lul
just a bunch of if statements to determine the day
Btw I think you should go to spoiler channel or search for answers online
I find AoC to be a very good event for learning
And lots of copy pasta
Or maybe some import commands if you were hyperly-organized the days before
Oh ye im not coding rn but when im going to im indeed hanging out in there
Don't even know where to start with part 2....
Want to discuss more in #aoc-solution-hints ?
Yeah, I will in just a minute
Actually might just take a break, feeling a bit defeated atm
:( Ok let me know if/when you want to discuss about it
@low condor you made a non-naive solution if i read the chat correctly... can you give some hints regarding that?
god I have a headache
Because of AOC or just in general?
Because of AoC, just having trouble wrapping my head around things today and a lil discouraged because I'm falling behind on my workplace's private leaderboard. I think I need to accept that I won't solve it right now, though, just banging my head on a wall at this point
Remember itโs ok not to solve a problem. 25 straight days of programming puzzles can take their toll
I have been surprised to see how many different approaches there are to some of these problems.
Obviously some approaches are better or worse than others. What I've been wondering is whether there is a... not so much a "right" answer or approach but perhaps an intended/ideal one?
that is one of the very interesting aspects of AoC puzzles it that they can be approached different ways.
people have been brute forcing using GPU cores, it's wild
I mean, pedagogically, that's probably the point, right? That you learn how to match the right tools to the right problems.
Hahaha WHAT, I haven't seen that yet. That is bonkers and kinda cool actually
My brain knows this, my heart can't help comparing myself to others. The human experience
i was proud last year that I only earned 39 stars, because it meant i didn't drive myself nuts getting to 50.
if it helps you feel better I just found this yesterday so I'm still stuck on part 2 of day 1. Although I think while I was lying down under my cat a little while ago I figured out an approach that will probably work well so I'm gonna eat food and then try it out in a bit ๐
I feel like every day I learn that rest is the best thing for problem solving but I never believe it
now doing day 7, it's actually fun
I looked at the hints and saw ONE idea that hadn't occurred to me and then suddenly I had a bunch more ideas. This is really fun! I love Python โค๏ธ
Gave it a good try but today's been too much for me. See you tomorrow
Nice
How do you learn it? Just by reading or by experience?
well uhm very intersting case here
test case 1 works 2 doesnt but my solution is correct
@cyan sleet how is the fortran
Have you gotten it yet?
i gave up
i think i'm gonna have to finish my finals before doing more ngl
previous days have eaten up multiple hours per day ๐ฅด
part 1 doesn't even seem too hard to me after i solved it
but somehow my code was absolutely riddled with errors during the solving process
spent two hours tearing my hair out while thinking it's supposed to be the easy start
and now part 2 is crazy
the festivities of aoc have truly begun
This is crazy lol should I go back and do every aoc
I haven't done anything before 2020 ๐ง
very nice.. I have only 105, exactly 1/4th ๐
8 minutes
today is going to be interesting
I landed in Japan at exactly 2pm 6 days ago, and my sim card is only for 6 days
so I might not be able to leaderboard because my sim card runs out and I have to change it
well that and also I'm bad at writing code fast
you could use wifi somewhere
I could but I don't really trust the free wifi
Oh that's fun
i mean idt aoc takes too much data
Their sim expires exactly at unlock lmao
I very nearly asked what time zone before realising they said japan so I could just google it lmao
lmao
Anyway GLHF everyone apart from stickie ig
i thought japan was in the same time zone as ph but i realized beijing is too
<@&518565788744024082> Good morning! Day 11 is ready to be attempted. View it online now at https://adventofcode.com/2023/day/11. Good luck!
and that's far from japan
Language Roulette: Day 11
The language is ... Perl
oh hey, it's not midnight for me anymore
Done
Sub 10 minutes today, wow
time
NOOOO
๐ญ๐ญ๐ญ
I almost fell into the trap
today sucked absolute balls
YES
just discovered about this
damn i sucked
can't work on it until Sunday because of finals though ;_;
no p1 just took way, way too long
p2 i had to remember how dijkstra's worked as well
(||pathfinding wasn't necessary, because the distances are just Manhattan||)
closest i've ever been to the leaderboards in p1
i seriously had to count the distances across the test input manually to verify if my solution would actually work
that cost a lot of time i think
I ||wrote 1000000 instead of 999999 in p2 which cost me a good 30s||
||I was using 100 - 1 for example input and then forgot to change it||
NOOO
Nick finished more than 30s before me tho so I'd only have gained 1 point
i spend a lot more time trying to figure out if my solution makes sense than just testing the solution
but ig i also use that time to think the solution through
my template doesn't actually allow a test with different constants to the true input, so I had to skip the part2 test
it's annoying that the day doesn't provide the example answer for the right constant
truly a moment of all time
for real
I had to write the right constant, change it to test, and change it back
I couldn't figure out why ||(scale * n_prev)|| did not work for me. Then I just tried ||((scale - 1) * n_prev)|| and the results matched. I spent a good amount of time thinking this will not work because the formula did not hold for ||scale=1||. Then I realized part-1 was actually ||scale=2||
Days are going too fast for me to catch up
I had a fun time ||scaling up the density of empty space|| before calculating distances
scaling up density? you mean lowering the density
my method was more akin to ||scaling everything up and then scaling the galaxy space back down||
I didn't have time for coding AoC yesterday ๐
Do i still get 2 stars for doing day 10 today?
yep

You are not allowed to use that command here. Please use the #aoc-bot-commands, #sir-lancebot-playground, #bot-commands channel(s) instead.
๐ฆ
Too many holiday parties this weekend. Just finishing 10 p2 now.
Sql was not a good choice for that part.
Fortran day 10
god i have no idea why i'm so salty about day 11
this whole event is just a funny lil coding thing
i cant believe i just got timed out by AoC
i've been submitting the sample input
im actually an idjiot ๐
youre not getting past the voice gate this way
stop before you get voice banned
Ok if itโs like this then its ok
How are you doing today?
Youโve ate well enough?
Tell me about yourself
Something interesting
This is off topic for this channel
Bruv
And if you try to spam messages you will be voice muted for two weeks
I havent spamed i was being nice ๐
be productive member of the server
be allowed to use voice channels
now go to offtopics please
โ ๏ธ DO NOT SPAM to meet these requirements, or you will be banned from verifying! โ ๏ธ
Any messages that are sent only to get your message count up are considered spam. To get your message count up without spamming, participate in conversations in โ python-discussion, or use the text chats for the voice channels while you listen.
How will they fit other problems
that's why the spaces lol
lol
that's great haha
not even first smh
even funnier is when you look at their github
looks like someone is very active
smh
internship hell
You are better off asking that in #python-discussion
oh sorry xd
Np
yo guys, anyone know of a good way to test code for deay 10 part 2? mine works with all the examples but gets the wrong answer on my input
is it close?
how would i know?
might be an off by one on the replacement?
are you correct for the*10 and *100 numbers?
For the example data.
ah wait, you're asking about day 10. sorry I was thinking day 11
ah dwdw
which method did you use for part2 ?
and 312 is probably close, there are many different inputs, my andswer for part 2 was in the 300s as well so you're pbably close.
cap
Which method is it? That link wasn't to your thread. Have you looked at any of the posted solutions?
copilot pls
we're probably going back down
it's not the first year where days are out of order in the display
you did it?
I did
incredible
๐คจ
yeah. i mean, it is older by like 20 years
I did end up making some macro terribleness to shorten some code
man I wish I could play along
Why can't you ?
what is the language use to make this interface?
this is not the right channel. Try #ot2-never-nesterโs-nightmare
okay, taking a crack at today, wish me luck
I've given up on our private leaderboard for the moment, think it's healthier that way
best of luck!
finally finished day 10 p2
completely missed that ||we're not just looking for . but also for pipes that aren't part of the path|| 
Advent of Reading Comprehension ;)
honestly it's a blessing that ||those pipes not part of the path also counted as spaces to check||
||otherwise pick wouldn't have worked||
??
hola
exams ๐
hola
hullo
trouvรฉ et toi?
เคขเฅเคเคขเฅเค เคเคฐ เคเคช?
ๆพๅฐไบ๏ผไฝ ๅข๏ผ
fun with google
how is it the 12th day already?
GL everyone
GLHF
24 hours is pretty fast :)
comment ca va
<@&518565788744024082> Good morning! Day 12 is ready to be attempted. View it online now at https://adventofcode.com/2023/day/12. Good luck!
Language Roulette: Day 12
The language is ... PHP
lmao
๐ฉ
I really need to get on these challenges, finals have been kicking my butt
||p1 is bruteforcable||
ping
I have no hope to complete it this month either, but that's ok. I enjoyed what I can do
I've only gotten one star, and that was day 1. When I get time I'll sit down and worth through some of them. I think I prefer it as a list of fun puzzles over a timed event personally
solely based on the leaderboard, todays part 2 looks like a doozy
Meanwhile I'm still trying to figure out whether to ||bruteforce|| P1 or try ||math|| (not really a spoiler, but just in case)
Join the group of waiting for the leaderboard to fill so we can check Reddit
I just want hints not spoilers
Yeah, read the hints some comments have, or pick a really confusing solution that you can't understand, and don't look too deep at it
Not the longest, but nearly 23 minutes to fill the leaderboard is pretty good
P2 is gonna be horrifying, isn't it
Ok, this is a "I'm not solving this tonight, I'm going to bed" day.
Smart
ayy I'm back on the global lb
massive W
i thought you fullsolved already ๐


