#advent-of-code
1 messages · Page 4 of 1
i still remember several times where my program ran as expected on first try itself. good memories
damn
elite programmers be like
Is day 5 as straightforward as it looks? Is there a crazy mathy solution?
Was really pretty simple
no you need to solve the halting problem
Don't know about maths because I can't maths because I'm a dog
Hmm last year there were a lot of opportunities to use numpy, this year has been a bit meh so far 😔
I feel like it's been easier this year so far compared to previous years
I've actually been able to understand everything in a reasonable amount of time
So... I agree
nice opportunity today, though, somewhat
Even the part 2's seem to be on the same difficulty as part 1
which is not often the case for historical part 2s
Day 5's only challenge was parsing, lots of people just edited the input to parse it more easily
Cat, half of us misread the problem and solved part two first by accident
why bother, the crate state is already very easily formatted
It is, though for being faster people edited it, as said
Less thinking, faster parsing
Put in spoilers any details please!
tbf, if I were going for speed I would have reformatted to make the reading of crates trivial
well if you're gonna do that, just hand parse it as a static or const
woo, got it
oh no, the cratemover is over 9000
I am very pleased though, I only need to edit my crane_operation function to get part 2
➡️ #1049190474348503080➡️ ➡️
Hey guy
s
Is the goal of the Day 5 aoc is to make the crates say CMZ?
Like all 3 sections
Should it say CMZ at the bottom?
with the 3 crates
im just trying to clarify and see if I'm reading it correctly
you need to return the top crate of each pile in order after the crane operations
Terrible?
At the top of each pile of crates, it should form CMZ
You can see them shown in bold here, that is the result for the testing data
Hey y'all! As a head's up I've published our policy on how to receive help for Advent of Code in #aoc-faq.
tl;dr
✅ in #1047673173447020564
✅ in #aoc-solution-hints (you can make threads in this channel)
✅ in #1035199133436354600 (title must specify AoC and which day)
🤏 in #advent-of-code (small hints, spoiler stuff ||like this||, nothing major)
❌ everywhere else
should i read the amount of piles from the file or is it ok just creating a dict with 9 stacks(bcs the input file has 9stacks only)
or is this already cheating
There's no cheating
The goal is to get at the result
The path you choose doesn't matter
put the prompt into GPT to generate code for you.
Yeah that's just being pathetic 
Does GPT take prompts that long?
BRB
this is not the correct channel, if it's just html try asking in one of our off topic channels, #ot0-psvm’s-eternal-disapproval.
if i where to only learn one module for AoC what should i learn
itertools? or maybe re?
(ive seen those two used a lot)
collections seems to also be a common one
regex is super useful for input parsing for a lot of days
itertools and more_itertools are also great
there's honestly a lot of packages you could use for AoC
the ones i use a lot are re, itertools, collections, more_itertools, numpy, networkx, scipy, sympy
from most to least approximately
numpy
numpy solutions are my favorite
numpy is very fun
any specfic things i need to learn
or should i just google "numpy full guide" or something on youtube and try using the stuff
Yeah you mostly need to be familiar with the concept of working with the data as a group per axis or whole matrix or whatever
Basically doing operations on everything at once rather than looping over something
So say you have an array like this
array([[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
[10, 11, 12, 13, 14, 15, 16, 17, 18, 19],
[20, 21, 22, 23, 24, 25, 26, 27, 28, 29],
[30, 31, 32, 33, 34, 35, 36, 37, 38, 39],
[40, 41, 42, 43, 44, 45, 46, 47, 48, 49]])
And you want to sum each horizonal row. What you would do is apply the np.sum() function on axis 1
print(a.sum(axis=1))
[ 45 145 245 345 445]
also is it just me or is this year much easier than last year so far
do you not need to define an array as a numpy array to use numpy
Yeah was just looking over days 1-4 last year
definitely easier this year
this is my first aoc but i did do last years problems and i would say the first 5 days where more difficult last year (specifically day 4 last year i died on that one )
yeah i agree
My day 4 last year heavily used numpy 😄
which day last year was the exponentially growing fish
IDK what the hell this did but here
lanternfish, right?
yes
oh snailfish was 2020 maybe
thinking of the optimization for part 2 was quite cool but it did take me some thinking
ditto
ooh yeah i remember that
can you think of any other extremely useful things i should know using numpy off the top of your head (the thing you have given me now would have same me a lot of time in many problems )
which was snailfish
just looking at this
[1,2]
[[1,2],3]
[9,[8,7]]
[[1,9],[8,5]]
[[[[1,2],[3,4]],[[5,6],[7,8]]],9]
[[[9,[3,8]],[[0,9],6]],[[[3,7],[4,9]],3]]
[[[[1,3],[5,3]],[[1,3],[8,7]]],[[[4,9],[6,9]],[[8,2],[7,3]]]]
gives me PTSD
Seriously. That one was wild
that was like my longest solution --- i made a full-fledged node class
I felt like I came up with a great solution to it though, so it was also satisfying
I did an oop solution as well
How I solved it is that I ||flattened the structure||
i just had a bunch of recursive methods, they were all pretty simple though
oh god yes
Turned it into || a flat list of two-item elements, one element for the value, one for its "level" in the hierarchy||
Made explosions way easier
i did use eval for the parse:
||SNAIL_NUMS = [nodify(*literal_eval(line)) for line in aoc_helper.day(18).splitlines()]||
definitely the easiest way to parse for sure
i made a class too lol
gasp
Numpy themselves have put together a pretty good guide. i would read through all of this if you really want to be familiar with how it works:
https://numpy.org/doc/stable/user/basics.html
I've made some mistake somewhere in part 2 and i cant figure out where
this is bloody annoying
work with example input, add debug traces
whats aoc_helper here?
guy i pay to get my inputs
lol
!pypi aoc-lube
it's this, but an older version
no, not everyone uses a fetcher
I don't. I have a moral objection to it 😄
Although i may build my own input fetcher
...i probably should
I built my own little framework for executing the problems, timing, parsing, etc
ooh nice
This is so odd, when I run this snippet py for _ in range(move): crates[from_].pop() within my instructions loop it replaces every single item in the stack with a P?? I've never seen anything so whack, but when I comment these lines it doesnt do this. Does pop do something I don't know?
you intialized your lists with this probably: [[] * n]
pop just removes the last element in the list
Yeah, I just hardcoded something similiar to that - why does this make a difference?
I know
because thats n references to the same list
you need [[] for _ in range(n)]
to make n separate lists
i did this ```py
crates = [[], [], [], [], [], [], [], [], [], ]
are these not seperate
those are separate
fixed my mistake, i was indexing from the start instead of the end - still kinda dont understand the pop but ill move on
Question: do empty sets/lists count as "falsy?"
yup
ty
Day 5 is so hard 😭
We can give hints in the #1049190474348503080 if you wish?
I don’t need hints yet
It’s just that every part of this challenge is a… challenge
I only now finished processing and transposing the crate matrix
And moving the crates is easier said then done
That was the hardest part imo, parsing the initial crate stacks 🤣
Why did I not make it upside down?
That would make this a lot easier
Ok yeah let’s do that
gosh i am writing a list comprehension in a list comprehension in a list comprehension in a list comprehension
i am confused because i need one last list comprehension which idk how to write
why not write it in for loop style first?
once that's done you can always convert it to list element afterwards
sometimes that can be easier if you don't have a perfect idea in your head of how the list comp looks
Yeah I always start with a regular for loop unless the comprehension is trivial (and even then I end up switching it back half the time anyways for debugging)
How does the number of participants 900?
I thought the maximum number is 200
Thank you
you mean [[]] * n
why and how do AoC threads turn into #esoteric-python
People love code golf
when the problems are simple people find ways to entertain themselves 😛
yes!
oh awesome
there's no signing up to it, you can just do problems whenever
oh okie
you can even do problems from 7 years ago
https://adventofcode.com has this years, and you can click "Events" at the top to see past years
ah oke
be carefull this is so dangerous syntax it actually creates 3 list object which refers one another if you change value of one of them then changes the value each
If you follow that chain of conversation backwards you’ll see it started from someone having that exact problem
sometimes maybe this syntax is usefull
zip(*n*[iter(stuff)])
list(n * [ *iter(stuff)]) ?
i think that's useful
n*[iter(stuff)] creates a list of n times the same iterator.
hm
no i got it wrong
now i fixed it.
list( n * [ * iter(stuff)]) it should be like this maybe
asteriks should be in list because iter only a object
for example
list(zip(*3*[iter([1, 2, 3, 4, 5, 6])]))
returns
[(1, 2, 3), (4, 5, 6)]
this is true because zip returns object
but list(*stuff) is wrong
yes, you're right. accidentally i wrote list when i meant zip
because list only takes 1 argument
damn
do you know Terry A.?
i remembered his quote when see this syntax "an idiot admires complexity but a genius admires simplicity"

he is holy c and temple os creator as he said he is the best programmer in the world R.I.P
would this be less complex?
[stuff[i:i+n] for i in range(0, len(stuff), n)]
if not set(rge1) - set(rge2):```
this conditional will return true if the set has any values inside, right?
hey im having a problem with this code ```from Airport import *
from Flight import *
allAirports = []
allFlights = {}
def loadData(airportFile, flightFile):
with open(airportFile, 'r') as file:
for line in file:
line = Airport()
print(line) ```
the task is supposed to read airport file and put each line into an airport object using aiport class
will be true if the remaining set has any values.
Ahh okay okay thank you
so if rge1 has anything that rge2 doesn't have.
Wait it might be the other way around, no? Because of the not
This is the wrong channel for this, check out #❓|how-to-get-help
i haven't started yet, but this one will require some string manipulation to get everything into a format we want, yes?
Well, “require” is a strong word, many people hardcoded today :3
i saw a lot of ppl just handwriting their input lmao
i wish the input was a lot longer for today
seems like parsing is half the fun today
figuratively of course
i used match/case i was happy
the actual solution is relatively easy
i found an actual usecase for it
lmao
sounds like a skill issue
I used match/case for day 2!
or whichever day had rps
I'm still figuring out how to parse todays input
aoc is probably a good chance to learn numpy
Would numpy help parse the input?
for today's? You might be able to do something with it, but I imagine it'd be helpful later down the line as well
I suppose I'm spending the next hour learning numpy then
Seems like a library that is worth learning either way
I'd imagine numpy not being very helpful today.
I've heard guys talking about match/case, which is the new thing in python 3.10
that they used today
I'm going to check that out
i mean i used it tbh
||only to transpose the input||
day 5: ||If you're having problems parsing today's problem, numpy is probably not going to make things easier for you ||
day 5: ||i was far too lazy to parse. i wrote a fairly simple solution after, but my actual answer didn't use it for speed.||
||One of my ideas was to transpose the input as well so numpy might be useful but I'll also look at this "match/case"||
documented since 3.11: for x in *this, *that:, possessive quantifiers in regular expressions, operator.call(obj, *args, **kwargs), etc.
day 5: ||yeah, I managed to parse the input fairly easily without bringing in numpy||
day 5: ||. .||
15 mins
Are submission timers problem specific? If I'm struggling with a completely different problem when the new problem is posted, could a bad answer submitted at 11 of an old problem cause me to have to wait to submit the current problem?
I think someone discovered that the answer is no but I make no claims to the accuracy of that claim
&aoc c
Day 6 starts <t:1670302800:R>.
whooo
👀
10 sec!
<@&518565788744024082> Good morning! Day 6 is ready to be attempted. View it online now at https://adventofcode.com/2022/day/6. Good luck!
OMG OMG OMG
Wow
Ggg !
off by one lol
i should've done that way quicker
I can do you 3 better than that 🙃
i assumed this one would be difficult but i found this easier than day 1
3 lines of code
:/
yep ._.
Had to resubmit twice because I was off by 4 the first time but I thought it was off by one
I had to submit twice because I accidentally submitted a tuple the first time 🙃
Should probably add something to the submitter that at least joins iterables lol
Accidentally submitted ||the marker itself rather than its position||
I misread the puzzle and ||submitted the starting index instead of the ending|| 
hence why this is aptly named "advent of reading comprehension"
can you rename this channel to be that
The tests failed, so I didn't get timed out, but it took me a fat while to figure out what went wrong
Same
Me still faster than ChrisJL :V
whose that
Server staff
nice
I'm setting my goal of ranking higher than ChrisJL this AoC.
our resident owl
rooting for you 🙏
Gotta test with example input
Yeah, I did. Just took me a while to figure out why it was failing with the sample
Frustrated with myself. Wanted to do this one the moment it releases and fell asleep again until 30 minutes past release time ╚(•⌂•)╝
And then it's one easy enough that I could have done it even if I was in front of my PC barely awake xD
off by "one"
We need more puzzles like this I can make them on the bus on my way to school now
Online phone ide aint half bad
anyone else feeling like todays puzzle was too easy compared to the others?
yes
Todays was the easiest one yet imo
I found todays easier
Autocorrection messed with my spelling lmao
Why is the leaderboard bugged?
Some of the players got all stars on all AoC days, and other ones resetted...
Didn't realize it was some kind of red team CTF...
hello guys , any suggestions for pythoh libraries to help me in competitive programming ?
such as this advent : )
for this event oyu don't need any libraries
You're probably going to use deque, bisect, itertools at some point
And for 3rd party, maybe networkx
You should probably spoiler these comments, btw
&aoc join
Theyre not specific to any problem, just observations from past AoC years
Also not even specific to AoC, you will use binary search, deques and graph libs in competitive programming
Strictly speaking, no solution discussion is allowed here - except for light guidance in spoiler tags. Discussion of what packages would be useful is light guidance. Acknowledge the line is blurry though
this doesn't seem spoilery to me
there's not light guidance -- no problem is even being discussed
the difference between saying bisect is useful in general and bisect might be useful for problem x
I don’t think that’s a clear line that has been demarcated in the FAQ channel, but ok
people doing aoc in excel deserve this
There's more than one?
I thought I was the only one that tried
it came to me as a revelation as i was going thru the solutions on the subreddit
p a t h f i n d i n g a l g o r i t h m s
soon ™️
Thank you, i appereciate it
Sorry, an unexpected error occurred. Please let us know!
CommandInvokeError: Command raised an exception: NotFound: 404 Not Found (error code: 10008): Unknown Message
😔
I also know someone doing it in excel. They've gone up to D4 so far, but haven't been able to look at d5-6 yet
I think both would still be possible though, but manually parse the d5 puzzle starting point?
You just won't gain as many since other people have completed the puzzles faster already
Yeah, we follow the same scoring rules, just with a lot more people on a leaerboard
Oh well, I guess I'll personally rank myself with the stars I get this year
This is the wrong channel for general Python help. This is for discussing Advent of Code.
You can ask in #python-discussion or get help via #❓|how-to-get-help
We will be doing the Advent of Code Completionist role again this year, where people who get all 50 stars get a fancy pink role for the month of January to acknowledge the achievement
np 🙂
What about the regular role that is always there , I've seen it on some profiles, will I get that just by participating?
That's the role that gets pinged each day when the puzzle releases. You can get it by running !subscribe in #bot-commands and selecting it
Done! Thank you
😔
your subroutine needs to identify the first position where the four most recently received characters were all different. Specifically, it needs to report the number of characters from the beginning of the buffer to the end of the first such four-character marker.
For example, suppose you receive the following datastream buffer:
mjqjpqmgbljsphdztnvjfqwrcgsmlb
After the first three characters (mjq) have been received, there haven't been enough characters received yet to find the marker. The first time a marker could occur is after the fourth character is received, making the most recent four characters mjqj. Because j is repeated, this isn't a marker.

The first time a marker appears is after the seventh character arrives. Once it does, the last four characters received are
jpqm, which are all different. In this case, your subroutine should report the value 7, because the first start-of-packet marker is complete after 7 characters have been processed.
What does this mean? specifically because the first start-of-packet marker is complete after 7 characters have been processed.
how was the first start-of-packet marker completed?
||Look at the examples, and try to look at the characters four at a time||
@alpine pike You can also open a help channel if you want people to be able to help you a bit more freely. Just make sure the title of the help post includes that it's for Advent of Code and for which day
okie
the start of a packet is indicated by a sequence of four characters that are all different.
OHHHH
This one takes a bit of reading
can some one explain what day 6 question means
Any tips to understand the assignment faster? I noticed I spend almost 2/5 of the time, reading the assignment
||Look at the examples, and try to look at the characters four at a time||
Ig that's just practice in understanding those kinds of assignments
Should I read the story?
Nah, you can skip the story, but pay attention you're not skipping any important stuff
That seems to be the hard part.
Kk, I'll try to improve every day
Thanks
It's the score I think
Probably derived from how much you solved in how much time
Score based on how many people are in the leaderboard and the order each user solved
For n people in the leaderboard, the score goes: first person to solve task gets n points, second gets n-1... And so on, for all tasks.
Because "private leaderboard" is limited in size, bot stitches the small ones together and re-assigns the score in the same way, but for all people. Check &aoc lb on #aoc-bot-commands
doing these from my phone, hardest part is putting in the input lol
altho i assume logic gonna get tpo hard for mobile at some point
It’s not actually that difficult to parse. I definitely recommend having a go. And hardcoding is always a possibility to pass the day if you wish, though a full solution is ofc best
yeah thats the thing the old me would try hardcode it but now i always think about optimal solution so its really hard to force my self to hardcode
i will give it a try. not today tho maybe on a weekend
That’s good to hear! Let us know in the Day 5 channel if you’d like any hints
Mapped Hash set go brrrr
Yesterday's lb
on the aoc website?
Yeep
Not the global, it's the ChrisJL lb from [p]aoc join
&aoc lb
Here's our current top 10 (and your personal stats compared to the top 10)! 🎄🎄🎄
| Name | Score | ⭐, ⭐⭐
--------------------------------------------------
213 | (You) ChrisJL | 9190 | (6, 6)
1 | Oliver Ni | 11935 | (6, 6)
2 | Zeyu Chen | 11934 | (6, 6)
3 | Kevin Sheng | 11901 | (6, 6)
4 | Defelo | 11890 | (6, 6)
5 | Anonymous #1087784 | 11829 | (6, 6)
6 | Starwort | 11819 | (6, 6)
7 | Daniel Gu | 11797 | (6, 6)
8 | RadioactiveHydra | 11788 | (6, 6)
9 | Adavya Goyal | 11786 | (6, 6)
I havent had the time to start five yet 😔
fingers crossed I can crank both of these out today
I've glanced at five, seems like the bigger problem will be parsing
that's what I'm using too!
some useful utils
more-itertools is something I'll keep alongside as well
yea
haven't had to use that just yet
salt's lib includes a couple of similar funcs namely chunk, split etc
anyone else struggle day4 pt1?
im checking my test output and it should absolutely match so im a bit confused
&aoc lb
Here's our current top 10! 🎄🎄🎄
| Name | Score | ⭐, ⭐⭐
--------------------------------------------------
1 | Oliver Ni | 11947 | (6, 6)
2 | Zeyu Chen | 11946 | (6, 6)
3 | Kevin Sheng | 11913 | (6, 6)
4 | Defelo | 11902 | (6, 6)
5 | Anonymous #1087784 | 11841 | (6, 6)
6 | Starwort | 11831 | (6, 6)
7 | Daniel Gu | 11810 | (6, 6)
8 | RadioactiveHydra | 11801 | (6, 6)
9 | Adavya Goyal | 11798 | (6, 6)
10 | Oof | 11777 | (6, 6)
that's good to hear
heh, fair
Here's our current top 10 (and your personal stats compared to the top 10)! 🎄🎄🎄
| Name | Score | ⭐, ⭐⭐
--------------------------------------------------
337 | (You) AbooMinister25 | 5441 | (4, 4)
1 | Oliver Ni | 11947 | (6, 6)
2 | Zeyu Chen | 11946 | (6, 6)
3 | Kevin Sheng | 11913 | (6, 6)
4 | Defelo | 11902 | (6, 6)
5 | Anonymous #1087784 | 11841 | (6, 6)
6 | Starwort | 11831 | (6, 6)
7 | Daniel Gu | 11810 | (6, 6)
8 | RadioactiveHydra | 11801 | (6, 6)
9 | Adavya Goyal | 11798 | (6, 6)
you can link your account so &aoc lb will show your position by default
oh huh, I was wondering why it wasn't happening by default, thanks
&aoc link AbooMinister25
You have linked your Discord ID to AbooMinister25.
Please stick to the topic of the channel. This channel is about Advent of Code, not general python help. Person asking was already redirected out of this channel
So day 6 was quite easy... does this mean day 7 will be punishing? 😝
anyone here have experience in machine learning?
IDK. This whole year so far has been easier than last
I got like, three questions in last year, so I don't have much of a point of comparison
I'll probably somewhat get through the entire thing this time
I didnt do last year to be fair. Did ok in 2020 though. Perhaps they made it easier to make it a bit more accessible?
maybe we'll have a drastic explosion in difficulty tomorrow
What's the name of the leaderboard for this discord? I joined it but I already had a couple other ones and I'm not sure which one is which :/
&aoc lb
Here's our current top 10 (and your personal stats compared to the top 10)! 🎄🎄🎄
| Name | Score | ⭐, ⭐⭐
--------------------------------------------------
218 | (You) Ed | 9192 | (6, 6)
1 | Oliver Ni | 11947 | (6, 6)
2 | Zeyu Chen | 11946 | (6, 6)
3 | Kevin Sheng | 11913 | (6, 6)
4 | Defelo | 11902 | (6, 6)
5 | Anonymous #1087784 | 11841 | (6, 6)
6 | Starwort | 11831 | (6, 6)
7 | Daniel Gu | 11810 | (6, 6)
8 | RadioactiveHydra | 11801 | (6, 6)
9 | Adavya Goyal | 11798 | (6, 6)
you need to use the command - there are mulitple leaderboard (since they can only hold 200 people each) so the bot calcualtes the actual leaderboard by combining the individual ones
Hmm ok I guess I'll leave all of the ones I'm already on and rejoin this one. I just can't tell which ones are old and which is the one I just joined
can someone help me with day 3
Sure, do you want to either go to #1048465205916598353 or open a help channel?
nvm i need help i made a help post
am i wrong?
are the days supposed to be getting harder
No worries, they will...
https://adventofcode.com/2021/stats
Should give you an overview
&aoc lb
Here's our current top 10! 🎄🎄🎄
| Name | Score | ⭐, ⭐⭐
--------------------------------------------------
1 | Oliver Ni | 11959 | (6, 6)
2 | Zeyu Chen | 11958 | (6, 6)
3 | Kevin Sheng | 11925 | (6, 6)
4 | Defelo | 11914 | (6, 6)
5 | Anonymous #1087784 | 11853 | (6, 6)
6 | Starwort | 11843 | (6, 6)
7 | Daniel Gu | 11821 | (6, 6)
8 | RadioactiveHydra | 11812 | (6, 6)
9 | Adavya Goyal | 11810 | (6, 6)
10 | Oof | 11789 | (6, 6)
hmm.. how do I have it recognize my name/entry here?
&aoc link
You have already linked an Advent of Code account: Caeden.
That only solved part 1 and not 2, yes
Both parts got solved by the 13k+
Yeah as said, only 100 got stuck with part 2
is the leaderboard over all years or just this year?
Just this year
hmm... as I look at the leaderboard on the website, results are different
Leaderboards are split
You can't have more than 200 users per leaderboard
Hence there are like 10 or something leaderboard for the server
You belong to one of them
ahhhh got it
was going to say, there is way too much talent on this server for me to be in the top 30 😆
And the command uses the same formula across all leaderboards
Can I ask for help for last years day 24? 
rip
where can i see the advent of code "list"
i only just learned about this now
im sorry i didnt read #aoc-faq
keep forgetting these types of channels exist
what are y'alls strategies for reading the aoc puzzles if anything
kinda a dumb question but like
do you guys just read the bolded text, skim through, etc
I just lazily read through the whole thing because I enjoy the story 
I read the entire thing >.>
skip the exposition and getting to the actual problem
usually a few paragraphs after the start
then how will you know whether or not the expedition for star fruit is going smoothly? :(
I go to where it explains what the input means and then go back and read the exposition
read after finish 🙏
at times I start by looking at the input then write a bit of parsing code
it gives context for when I skim through the prompt
i love when my pc randomly shuts down and now is taking forever to load
or ive got to do it on phone :/
hello hello hello
i'm not being late to this one
but i bet this is the one that screws us all over
still can't believe Morocco beat Spain
probably, considering the difficulty level of the other ones
&aoc c
Day 7 starts <t:1670389200:R>.
where is everyone :(
i'm here
hola
that's what i've been saying for the past 3 days though
to set us up for the most disgusting problem ever
GLHF
it's okay, sympy had something for that
glhf everyone
same but i feel like since this is like the week milestone it might actually be difficulty
good luck everyone!
<@&518565788744024082> Good morning! Day 7 is ready to be attempted. View it online now at https://adventofcode.com/2022/day/7. Good luck!
Very interesting
went from 0 to 100
alright looks like it got harder huh
Just a tad
Not that much harder than finding four unique letters in a row, right?
what???
the jump in difficulty from day 6 to day 7 is insane. This one is particularly hard since it seems I can't use dicts
no, u can
there are different directories with the same name tho?
||you don't just use the folder name as the key||
#1049917148186804275 aaaand now I go sleep
fff
I started 3 minutes late. Luckily an additional 3 minutes on top of a 20 minute problem isn't the worst handicap. Not nearly as bad as it would've been if I had started 3 minutes late, say, yesterday.
yeah yesterday was really easy for some reason
i think 3 minutes would already take you off the leaderboard
love when my code works for the example but not my input
are you relying on directories having unique names?
nope
rip
no
wait can 2 folders in the same dir have the same name?
apparently they don't
damn
no
no, dts
luckily 💀
ok then my code should work fml *made a dumb mistake
i've somehow committed myself to the same challenge i did last year
where i'd try to do each problem without any imports at all
even stdlib
lol good luck with that
imagine being locked out of regular expressions
it was hell last year
couldnt even use like simple mazesolving stuff unless i recreated it from scratch
well it's not like that's in stdlib anyway
yeah ig
holy shit
i just realized
there's nothing stopping me from just importing networkx or something
lol yep
Not top 1k, so it didn't tell me at all
it'll tell you in /leaderboard/self
Oh it's 10k for leaderboard/self neat
Yeah 2574/2099
does this thing backtracks weirdly?
like this cd / switches the current directory to the outermost directory, /. is only for / right?
or is it for any directory in the tree?
i mean, does it work like actual cd, or is it jumping weirdly, part 1
I've been working a problem from 2018 for the last two hours... works on all 5 examples, but somehow the answer is less than half what it should be. That is the worst.
dont use the examples
oml
this saved me
i wsa stuck for a while lmao
fck that took me too long
yeah took me a while too, I misread part 2 like an idiot and thought it was asking for the directory name 🤦♀️
The description they said works just like real cd, I don't understand your question. Both real cd and the one in the problem, cd / will jump you to the root directory for the system.
same, my first instinct was to rewrite it, such that i can extract the name
I didn't read it work like real cd
Yeah, i know cd / jumps to /
but i didn't understand if that meant it only jumps to /, or if it means you can jump to anywhere
given the input has only one "cd /"
if you think thats bad, 2 years back I got an input that when I opened it to download my browser tried to translate it so it had like 2 random bad characters in it
Yeah thats why i ask
and again my code works for example and not the input 😭
are you talking about problem 15
dont use the examples, there's like this inclination to use them as tests
they are not
they are examples
I always use the examples as tests for my code
as long as you understand what they are showing thats ok
Nothing wrong with using the examples as tests
but they are not tests
they help flesh out stupid mistakes
lol done. That took me very long, but it was also very fun
now have to worry about the edge cases
That one took me a while, but I never ran into wrong answers that passed the examples for that one. I'm working on 2018 day 20.
☝️
I found one edge case so far
There are edge cases?
Regex defined mazes
I don't think there are any prominent edge cases here
woops, replied to the wrong comment
I see
15 was the only one from 2018 I did
maybe i'll try 20
Wait jk I also did problem 5
but weirdly I don't have my code for that day
Jumping around can be a little odd at times because some problems build on problems from earlier in the month, though maybe some of them you'd pick up on that from the problem description.
Though 20 is a standalone, I was just thinking about 2018 problem 19 which builds on problem 16
2018 day 23 is one of my all time favorites
this problem is interesting :) I've managed to get the examples right but the real incorrect
So part 1 i am getting the test just fine, however, my input is returning to low. Not sure where to go
the example is not a test
if you got the example working, most likely you are missing this, at least its what i was missing:
In the example above, these directories are a and e; the sum of their total sizes is 95437 (94853 + 584).
a = a + e, but you also need e
right, so I am getting the 95437 as a answer to the example.
the answer is in the 1m
Yeah but the example is not a test
and if I look at the values it returns both a and e as the totals under 100000. Yeah I am in the 1m range
true, I get that. I didn't write a test around it. Should have called it an example
whats your number
is not under, is at most
right <=
sent ya a DM
do you mean (for example) failing to count the size of e when calculating the size of a? ( i don't really understand)
Finally done... I'm not made for solving those riddle quickly. At least not at 6 a.m.
Do you get up early for these or is that the normal time you get up?
I get up earlier than usual, yes xD
But only since I have to go to work anyways. I won't get up early on weekends
They're posted at 11 pm my time and my usual bed time is 11:30 pm (though its 1 am now). Especially for the problems that take 3+ hours, it really pushes back my bedtime
I'll take my 11 pm over 6 am though
no, the opposite
taking only into account the size of a
Can anybody suggest learn to odd frame work chanel or any course
I would also prefer 11 pm
At some point the solutions take so long that I will run out of motivation
ah
(i'm getting the opposite issue, too high)
I am trying to get into the first 10k. I'm not experienced enough to do faster.
So far it only worked on day one
the thing is competitive programming has a meta like any competitive scene in videogames
the only example i know cause i played it in the pandemic is aoe
you can either play it normally, or play it competitively, where you need to reach certain goals at certain clock times
yeah, I see that with all the golfing, to get the shortest solution possible
there is an entirely different meta-game to that, you need to learn build orders and set your shortcuts and stuff to reach that timing
thats another thing
code golf can be done slowly
The last two years I managed to get 2 parts onto the global leaderboard. Would be nice to beat that this yeoar
thats cool
By the time I have read and understood the riddle the leaderboard is full 😂
At least for the first few days
good luck
Some extra long puzzles can take over an hour to fill up. But yeah, generally I'm skimming the riddle and often even missing important pieces that I have to later correct in my 1 minute downtime from submitting a bad answer.
If you are interested in the timing aspect you should look into the competitive programming meta
Well, I have to go to work now. Cya
Its mostly about learning a bunch of common data structure and algorithms and building a system for quick snippets
@mossy basin
Sorry, for the ping, but aoc_lube is raising an error
probably because im on windows
I'm not salt but what's the error?
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\caeden\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\aoc_lube\\code_template.txt' - Should I write the template myself, or is it in some other dir?
That's weird
that is weird
I saw that too, I think it's a bug and the default template file doesn't get packaged into the builds
i didn't know that
Stupid question but does that also happen with aoc_helper? (aoc template)
I know .ini files don't get packaged. Maybe .txt files are the same way.
i'll fix it, but you can copy the template from the github if you want
cool, thanks
i've copied it in so no rush
under options in pyproject.toml add:
include-package-data = true
oh never mind, that's true by default
[tool.setuptools.package-data]
mypkg = ["*.txt"]
if you don't have a MANIFEST.in
should be fixed in latest version (hopefully!) up on pypi
Oh it should be fine then because it's a .py
oh, just a me problem then
Does anybody know a way to download the input? I'm trying to do the task on my phone (cuz I'm at school) and can't copy the whole thing (the phone just won't let me)
Hey @tidal kelp!
You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.
inputs are different per person
oh is it
yeah
didnt know thanks for pointing that out
cant select all copy paste? works for me
also andriod has this button
idk about ios
After I select all I can no longer copy
The option just disappears
aah rip
And the download button downloads a pdf
And after conversion it uses weird $
That python doesn't see as dollars
after openinh?
i think u can,change encoding
cause that sometimes messes things up
im getting a txt download so i have no clue why your getting pdf
This is a python server, so I don't think you'll be getting much help with this
ty
boo parsing
parsing is the most important part of life ... 😢
Parsing is fun!
Depending on how you code, you might have access to the command wget, euch enables you to download the file
ah butts, today involves tree navigation
I might actually want a class to handle some of this
i think imma have to use example input, logic doesnt seem to work lol
and far too much atm to debug properly
oh wait they give a small example input
thats pretty useful
probably on purpose too
bruh moment, mistake was wrong indentation, which i only made cause mobile programming is weird lol
Spoilers!! 😱😱
ok took way too long but day 7 done!
ooh boy, there are a lot of moving parts in this, if I don't get it right on the first guess debugging this will be unpleasant
You always have the test input if you need it
true, i should set up some generic unit test scaffold at some point
ipython is nice for this kind of stuff, sticking your test input into the REPL and messing with it to see what works
I just use PyCharm :) Sticking a breakpoint somewhere and looking at the variables in the variable explorer is my favoured approach
print()
print() is good but can be a pain for structures with multiple levels
With PyCharm you just have drop-down arrows for each level, which is sweet
man, really hoping all the directories have unique names
welp, that's me all buggered
tfw test input works but not the actual input 😭
They do if you consider the entire path
🤷♂️ My implementation wouldn't have cared so IDK
||directories/files in different locations can have same names||
thanks, that is probably the issue in my case
Are there any spoilers at the bottom of day 7 channel rn?
day 7 was cool
still having problems with aoc_lube
import aoc_lube
RAW = aoc_lube.fetch(year=22, day=7)
print(RAW)``` is raising `Request failed`
I am supposed to copy the token from the value of the session cookie in the adventofcode.com request, right?
Yes
Odd
See if you can find your cookie
It should be in something like ~/.config/aoc_lube/session.txt
Not sure exactly the path aoc_lube uses
When I print session in the aoc_lube source code it prints the token as bytes instead of hex, is that what is supposed to happen? For some reason its converting my hex token to bytes ```py
TOKEN = {"session": TOKEN_FILE.read_text().strip()}
print(TOKEN)
¯_(ツ)_/¯
That's a question for salt more than me
Btw when you say 'it's converting [your] hex token to bytes' do you mean it's printing {'session': b'<your token>'}?
No, but its lots of these \x006\ characters
not sure what exactly those are called actually
Ok open your token file with VSCode and tell me what encoding it uses
It'll tell you in the status bar
UTF-16 LE
Yeah that'll be it
Click UTF-16 LE and select 'save as encoding'
Then choose UTF-8
I see, the print here is now printing my hex token - Still failing on the request unfortunately
Have a go using aoc_helper and see if it still doesn't work
What version of aoc_lube are you using btw?
0.2.5
i'll try aoc helper
just updated to 0.2.6 and same problem
Huh, worked the token worked with aoc_helper in cli
@mossy basin something is broken with your request handling, see @halcyon pulsar's problem above
(discussion starts here)
I figured out his problem
Its returning 404 because its trying to make a request to https://adventofcode.com/22/day/7/input
when its 2022 not 22
Ah
Not sure why it works on linux
I assume other people aren't having problems somehow
I think you're just supposed to pass the full year
Don't remember if there's a check for that in aoc_helper or not
Huh, makes sense - The template auto generates it without passing the full year however
¯_(ツ)_/¯
RAW = aoc_lube.fetch(year=22, day=7) this is what is generated from the template
ok no aoc_helper does not contain a check for year < 2000
Just added this file.write_text(template.format(year=f"20{year}", day=day))
There we go
Works now
lmao you're supposed to do 2022 not just 22
Btw @woven sable how has fixing the testing stuff from your PR gone?
ah yes, AOC 22 AD
If it doesn't work I might just revert that pull
The elves want you to count these rocks
How many rocks are in your input?
lolol
A few hours for me this morning. Partly due to brain being slow. Partly due to an assumption being wrong that took me a hot minute to work out (the dreaded the test input works but real input didn't moment).
A couple of hours
You too?
I'm slightly less embarrassed now
I have free time today, at least
It's a very deliberate thing AoC does. I'd be amazed if there is a single person who has done more than a few AoC puzzles that hasn't had the same thing happen 😄
man, was feeling great when I checked where I was on the leaderboard before going to bed last night (51) and then checking against this morning was a real downer (80) 😆
guess it's still a net upward migration, as I started out at 97
i've gotten all of the files in a directory form but im stuck on the recursion part, rip
did you guys use classes
yay first time I'm struggling this year
mostly because my code is too ugly to debug
What language should i learn by doing aoc
c++
Currently doing python but looking for a language i dont know
I'm already using c/c++ in robotics, i want to learn a new language
Rust?
rust rust rust rust
It's a compiled language that has speed comparable to C and ergonomics comparable to Python (after you get your head round the borrow checker)
Borrow checker?
Stops you from committing UAFs, data races, double frees, etc.
Took me about an hour for first part and an additional hour for part 2 cause I misread instructions and thought something was wrong with my code and never went back to instructions
Rip
Had to ask in the spoiler chat if I was being stupid or not, and I was indeed being stupid running on 5 hours of sleep without coffee
Rip
This is my first time doing aoc seriously. How many days can I expect the difficulty to be at this level before there's another jump?
This year already has a much different difficulty curve than the other years
Its mostly been parsing this year
It's usually a fairly reasonable curve up to the 24th (then day 25 is easy because yk it's christmas, gotta be nice and fast)
It's also usually easier on weekends
Easier on weekends is a nice touch. Sounds like my goal of reaching at least day 18 is probably feasible then since it ends on a Sunday, so I'll hopefully get a few easier puzzles
I think I'll do rust this year and elixir next year
Go for all 25, it'll be worth it :)
I plan on going for all 25, but I do want to reach at least 18, after that if puzzles take me too long I'll do them over multiple days just to try and complete it
time finally freed up, I can get to 6 and 7 now 🎉
Nice
Awesome, good luck on that 6
kekw
I'm really stuck on 2018 day 20. I don't even know if I'm messing up somewhere in calculating the map from the regex or calculating the farthest room once I have the map. I can't find any flaws in either and both of them work on all 5 test cases. Could someone that has a working solution see how many doors my input produces: https://paste.pythondiscord.com/raw/oronaqedeh
Oh god it's that one LMAO
Instead of telling you your answers (generally frowned upon) I'll give you my input and answers
And you can treat it like a test case
fuck, my parser is wrong.. I now tested multiple ways of calculating the sum and they all add to the same
Just asking for number of total doors as a test number. That isn't what they're asking for, but that works too.
Oh yeah I have no idea how to get that, I barely remember how my solution works LMAO
One mo
ohhhhhhhhh I only need the directories fuckkkkk I read the task wrong nooo
https://pastebin.com/n7DdW5yW, 3675 / 7953
And yeah my laptop doesn't even have my 2018-20 solution on it lmao
That must be on my desktop
The link says unavailable. Are those your part1 / part2 solutions?
WTAF
Oh. 6
Those are my solutions, lemme host the input on my own server for you
(apparently it's in Luxembourgish)
eh whatever I'll do this later
Finish it!!
later 😔
Suffer with the rest of us
Yeah, mine is crazy low, giving me 2112 for part 1.
with your input
thats input?
if so, for which day?
Yes. 2018 day 20
Its a maze. Written in regex notation.
ah 2018
😰
I would post code but I’m doing it in a different language then python
I don't think its wrong, you have probably just misunderstood the assignment -
Wdym
just a reminder, #1047673173447020564 if you want to discuss solutions
Yep, I’m just confirming I have everything understood correctly
its been 3 hours now im dying
Work with the sample input. Make sure your structure is exactly as it is in the example
Does your code work with example?
Check that ||absolute cds|| work correctly, I had a bug where it would completely break my cwd
I'll work down my input
these are spoiler discussions and need to be spoilered in full @halcyon pulsar @unique osprey
this also needs to be spoilered @surreal sky
thanks
Oh ok
pls check #aoc-faq message
👍
sorry, didn't seem like a spoiler but i guess any hint/observation counts
if you don't want to fully spoil yourself with #1047673173447020564, you can discuss here with lots and lots of spoiler tags ||like this|| with the relevant day/part # stated



