#advent-of-code
1 messages ยท Page 43 of 1
Im gonna do this in the morning when I have the brain capacity to do it
ima do it rn
this seems easy
Mark my words I will have a beautiful object-oriented solution to this one too, but tomorrow ๐คฃ
Hah
!remind 19h actually do this ๐
Your reminder will arrive on <t:1638835775:F>!
i am doing oop :D
Iโve done it the past couple days and Iโm pretty happy with it
Nice code is also much easier to get right and also to debug
yea it looks so neat too
I've yet to use OOP except for yesterday's bingo
I'm just using horrible logic and for loops
I'm at day 3 part 2 and I'm having some problems with my code, I'm at #help-apple, any help would be greatly appreciated (if anyone is free at the moment)
I think questions about AoC solutions are supposed to be contained to #advent-of-code-spoilers-archive
i wont be doing todays thing rn but how does it look so far
oh i see i thought we can only ask for help in the help channels
Looks fun, great profile pic btw
thanks lol
ez
oh no my sol is going sooo slow after 30 days smh smh
!remind 5h Do advent of code day 5 and day 6
Sorry, you can't do that here!
is it just slow or will it crash my comp
!remind 5h Do advent of code day 5 and day 6
Sorry, you can't do that here!
!remind 5h Do advent of code day 5 and day 6
Sorry, you can't do that here!
what
#bot-commands
it didn't work the first time, it's not gonna work the second or third time
^
map's faster or recursion?
Took me longer to compute the result then it took for me to write the solution
kek
Mine has been computing for 25 mins and counting
thats probably not the correct way to do it then
if its taking > 15secs
Something is wrong then. Everyday till current should be done in milliseconds.
You should probably take a quick look at your code
Doesn't sound right
I looked at my code and tried to change some things and I have both versions running, we could talk more in #advent-of-code-spoilers-archive
try to ||view the problem in a different prespective||
try to make a general form ๐ฉ
#help-bread if anyone's free, I'm on day 3 part 2
My computer crashed in the second part..
same
that happened to me in 2019 aoc
guys, can i get a lil hint? .w.
i interrupted when i saw it was looong
ok so after listening to music for this: all too well is some great background music
you don't notice it, it just plays in the background
use a ||dictionary||, with || lists on p2 you'd need terabytes of ram ||
ohh
i dont get what the second part's asking
my ram spiked to 7 gb usage and almost crashed my pc
isn't the second part same thing as first, but different day number?
it is
oh, that's kind of dumb then
not really
get ready with yer keyboard interrupt
if you do it like most of us did you will hit your resource limits very fast
yes, but the naive approach that works for part 1 doesn't for part 2
not really.. first part runs fine. second part will blow up your computer.
huehuehuehue
hmm, i see
i thought the same thing tho i was like wtf
the second part is a trap for those who did the first problem inefficiently/naively
And I fell in it.
I literally solved first part in 10 minutes and wasted 40 minutes in the second one.
I looked at AoC a bit, does user have any control over which challenges are presented, or do you just take what they give you?
the latter
ok thanks
course there are 5 years of old challenges, 50 per year, so you can take your pick
is it possible to search for certain kinds of things? for example suppose I want to see only problems involving nested FOR loops
would i be better off looking at another resource?
Probably leetcode
Also CodeWars. You can filter by specific things - e.g. easyish Python challenges involving loops: https://www.codewars.com/kata/search/my-languages?beta=false&order_by=popularity+desc&q=&r[]=-8&r[]=-7&r[]=-6&tags=Loops
that search string returned 0 results but it's probably just a little string problem, I get the idea, that's excellent thnks!
Oops
I did an O(n^2) solution for the first one
no even worse
I had to use ||dicts|| for the second part
it's exponential growth
yeah, something like that
1 fish becomes 2 fish in x days. 2 fish become 4 fish, 4 fish become 8, etc
unless you did some other kind of algo
an algo that ||simulates each individual fish every iteration|| will be exponential
if you came up with an O(n^2) solution, part 2 shouldn't be that much slower than part 1
wow leetcode also looks useful thanks @dense solstice
๐
lmfao I was confused as hell as to why I kept getting answers that were too high. turns out I was getting the number of fish at 265 days instead of 256 days
welcome to clown town
population: me
LMFAO
anyway solved it now
although my friend is doing them faster than I am, and he's doing them in x86_64 assembly so I can't feel too good about myself
lmao
typos\โข
lmao
It runs fast enough that time can't measure it so I'm very happy!
โฏ time ./Day6
372984
1681503251694
Day6 0.00s user 0.01s system 48% cpu 0.018 total
```:D
ooo
whoa i actually made a video about this
spoiler: it is not very dangerous
original name of this trojan is offiz according to kaspersky, but that won't be familiar to anyone so i just named it youareanidiot.
now maybe people will stop asking me to make a video about it!!!!! http://www.twitter.com/danooct1
the fish:
yep, mine took 0.0017s
python lol
what about you?
Haskell
ohh damn. I learned it a bit but it's functional nature is like none other. Takes hella time to perfect
yeah, that's why I'm using it for AoC
trying to learn
hello
you'll likely need a new strategy
The fish shouldn't be nlogn pretty sure
Everything except the number of days should scale to irrelevance and it should come out to O(n) where n is days
general rule is that if it doesn't finish in 15 seconds it won't finish before the heat death of the universe
also my solution for today is only 25 SLOC!
oh if we're golfing python we can absolutely get this to a one liner
sorry, it's 25 SLOC and semantic lol
if I wanted I could make this a one-liner too
helo guys me noob how do i solve aoc?
I really don't understand day 3: part 1, can someone explain it?
You got to find out which board wins bingo first according to the keys in order (at the top of the input file) and then score the board that wins
ok dumb question, but for day 6, how are they getting 26 for the total lantern fish?
in the sample output
run the simulation for 18 days, then count how many fish there are
as in, there are 26 numbers in the After 18 days: 6,0,6,4,5,6,0,1,1,2,6,0,1,1,1,2,2,3,3,4,6,7,8,8,8,8 list
oof me, i was tallying only the new fish being born
sometimes i need to read
lol part 2 is a huge trap
my code is terribly optimized
i changed one number too
but its taking forever lol
it should be an O(n) operation
Please
yeah
ok
All other variables become irrelevant rapidly
list shouldn't be growing
you probably shouldn't have a list that's growing...
the list will get too big for that
yeah, you'll have to change your approach for part 2 if you don't have terabytes of ram lying around
yea true
pycharm's memory usage was certainly spiking
think i left the script running for 5 minutes lol
Welp, there goes my plan
For || "best case" I should only loop once over the days and nothing more? ||
192M lanternfish til now, still waiting...
It's a trivial operation per day
LMAO
It will take long
It's exponential so yeah
Good luck
See you in a few days
yakho kifach
I got 1'644'286'074'024 as result so you can do the maths
see you until the heat death of the universe

No need to wait here 
Well I just need to hope everyone above me on the leaderboard also has these troubles with this problem
I literally can't make 1st place unless there's multiple days of people above me not being able to solve some days
Too many days of only being able to start hours after the reset time
what is the key behind part 2?
i don't really understand how to optimize it
am i supposed to compute some kind of exponential function?
nah, you want to ||use dictionaries where the keys are the fish stage numbers and the values are the amounts of fish at that stage||
though there are other approaches, but that's probably the simplest
Welp you can join a local leaderboard with friends
these lantern fish should be exterminated
i think the list approach is simpler, doesn't require moving the numbers around each iteration
||With .pop() etc?||
wouldn't that choke up your memory?
not the brute force method, a different list approach
ah gotcha
Python is too slow, I does not compute day 6 part 2 for some reason
Anyway i can optomise it?
easier to code once you understand, I agree, but I find that way trickier to understand at first
||Not a list of each individual fish, but a list of [0, 0, 0, 0, 0, 0, 0, 0, 0] for the number of fish at each stage|| click that if you want the explanation
Yeah I was using brute force before, after about an hour my loop got up to day 211
But it would've taken months to get to 256
see the last ~15 or so messages, we're discussing just that 
what was the length of the list?
if you kept track of it
๐ a very big number, lemme see
its in the billions fs
Day 100: 2180834
Day 125: 19062620
And this is my old method btw, parsing every single elem in that list with if statements
For part 2 my len is
i used pypy
but no luck
1644286074024
what can i do?
You gotta optimise it
it kills the process right at 170
Yeah same
what
python isn't too slow to do this
youll have to change your approach altogether
What you gotta do is ||make a list storing how many fish are at each stage instead of storing each individual fish||
oh that idea will work
lemme try that
So something like ||fish = [0, 0, 0, 0, 0, 0, 0, 0, 0] and then every day you'd move the fish from fish[5] to fish[4] etc||
||If they're in fish[0] you'd just deduct that from fish[0] and add it to fish[8] and fish[6]||
what
My solution for number of fish on day 99999 is https://paste.pythondiscord.com/qigonamace.yaml
well that looked smaller in my program output
can i see my overall global rank somewhere 
there's a personal stats thing but it shows day-wise
my code for part 2 of 6 is kinda slow
"kinda"
lets say very
That was a lot smarter, thanks ๐
don't forget to fill out the AOC survey: https://t.co/hdp7AKLhfx
This is a quick (unofficial / not affiliated with) Advent of Code 2021 anonymous (if you don't disclose your identity in "Other..." answers) participant survey. Note that your data will be shared as part of a (possibly sanitized and trimmed) data set to be published under the Open Database License 1.0 (https://opendatacommons.org/licenses/odbl/1...
It says unofficial, but I got the link from Eric, so....
complexity of simulating the fish is O(2^(d/7)) where d is days
I forgot if the fractional exponent is simplified in big-O
probably is
today was diiiiiirty
Akarys42 is already tied to another account. Please contact an admin if you believe this is an error.
well, yes and also no
you should remove the constant I believe
it is O(2^(C*n)) where C = 1/7, C should be removed so you get O(2^n), right?
2^(n/7) = 2^(1/7*n) = (2^1/7)^(n) in O(2^n)?
Not sure if you can remove it
You'd need no seperate the 1/7 from n entirely but that seems unlikely now that I remembered how the rules work
2^(2n) is equivalent to 2^n in Big-O, right?
Yeah that should be the case
I think.
Might just be 4^n though
Ah nope it isn't equal
Cause you can't remove the 2 from the n so you can't find a constant to make up for it so you can't remove it
but log_b(n) is the same big-O regardless of b
I see people sometimes insist on saying, say, O(log2(n)) - that's silly, the logarithms are all equal
Yeah cause you can replace them all with ln divided by a constant
Making it equivalent 
yup
that I know
alright, interesting
how fast can you compute 999,999 days?
mine can do in 2.09 mins with a tooooon of logging
1e6 took me 6 seconds I believe
No logging though
Logging should slow it down a lot
1s for 1 million days for mine
O(C*f(n)) is in the set O(f(n))
You can't express 2^(n/8) as C*(2^n)
people are using big-O notation, something horrifying must be happening
Hahaha
anyway, i decided to use a deque and tqdm, and (so far) it is fairly performant...
First solution was || looping over each number with another loop inside with each day , yikes on me ||
oh haha my part one solution finished in under a second
for now it looks like a dude peeing on an ascent to me
oh god
:x: Please use #aoc-bot-commands for aoc commands instead.
thanks
today's aoc seems simple enough, or maybe appearances are deceiving
yay we did
are you on part two yet
part two is ||really really similar|| (minor spoil)
WOW
26 seconds for a million days
2.8s for one million days
it was slow as hell in the 2cnd one
What technique/language?
mine took 02.200580 seconds
in python
i used a dictonary
Who keeps pinging me
Ok i need some help testing my helper adn getting some opinoins, i added a rustlings like watch feature so you don't need to do anything once you start your puzzle
see 2021/02/solution.py
i need to edit the template though
once you get your puzzle by python -m aoc start -d {n}
just do python -m 2021.{n}.solution
and you will get into the watch shell
also it would be better if you test it on an alt if you already attempted all the problems
since there is no good support for already attempted yet
Ohh right I am subscribed but I thought there was an announcements channel separate from this channel?
There is, but these messages are sent in this channel 
Ah gotcha
Well day 6 finaly made my code not run instantly, kind of think that i might need to revise or it will never finish
wow i using the 5 number example and it has been over 4 min
lol 14 min
wondering what it will be with the given input
nice!
Im going to revise becouse im not waiting that long
damn it took me a while to just understand that part 2 of the day 3
it was so confusing, glad there was an example
are we meant to assume that the puzzle input for day 6 pt 1 is the first "day"?
No, you have your puzzle input just like any other day
damn that was quick
nice!
way easier than yesterdays
yesterday was pretty easy too
took ak like 8 minutes
he made some.. interesting functions
def interval(a: int, b: int) -> range:
return range(min(a, b), max(a, b) + 1)
def drange(a: int, b: int) -> range:
if a < b:
return range(a, b + 1)
return range(a, b - 1, -1)```
we can probably simplify it
I love how part 1 is so easy and part 2 is also so easy but then you realise you are missing 16TB of RAM and 15 years
to solve it
I've been programming in JavaScript for a week and I almost forgot how beautiful does Python's syntax look 
Day 256
it looks like a virus colony
yeah lol
guys how to settle it
This channel is for discussion of the Advent of Code event. If you need help with bot development, head to #discord-bots.
noted thx
lmfao
Haha
does anyone know a good online python ide thing
the one im using doesnt give me enough resources to do todays challenge
like ram?
idk it just times out before its done
you should try to find a more efficient method
My solution that ||simulated every fish|| was on track to take a few hours to complete
the number of fish grows exponentially, the answer is on the order of trillions
probably more
1-80 took less than a second to compute
yup
there's even a warning ๐
it's fairly easy to convince yourself of that
||Someone computed that if you want to create a list of all the fish for day 256, you would need 11 terabytes of RAM||
4kb of RAM back: I can go to the moon
10Tb of RAM today: damn too much fish for me
lmao
LOL
When the dolphins escaped Earth, they were like "So long and that's too much fish, cool it with all the fish, alright?"
time to buy a 16 terrabyte hard drive and make a 12 terrabyte swap file
Just finished Day 6
I love the Part 2 solutions that are like "do what you did a few more times"
But only if I get the trick
i just came up with recursion out of nowhere
||the idea of fibonacci||
lol i didn't think that would even work but recursion is epic sorcery
if you break down each function call and what is happening
spoiler this sentence please~
oop
Oreo can you send me your code I wanna see it
F
thank you~
i was mistaken , i though it was spoiler channel ๐ฅด
||they really said "solve the collatz conjecture" :trol:||
(may be misinterpreting the mission)
you can look for hints plus the solutions are also updated regularly on github and our aoc subreddit ๐ if you are stuck
I've done it ||with a list of how many at each stage||
I'm just curious how you'd do it with ||recursion||
shall we first shift to #advent-of-code-spoilers-archive
Kk
idk why u guys focusing on this so much just make a 12 terrabyte swap file ๐
||My solution requires 250 kb for 1 million days, imagine what I could do with 12 terabyte||
What do you mean by "logic"?
Well, there's usually a tradeoff between memory and time, so a really clever solution can either be optimized for speed or minimal memory footprint.
exactly
but i would take runtime as the priority
since the tradeoff is not too subtle
i hate online ides
i had the solution
and then the web page broke
and now i have to restart
So the step would be... find a link between the initial step, number of days and the population?
Why you using one?
and don't most of them have a save function?
im using an online ide because im on my school chrome book rn
i cant download python on it
gotcha
and i thought this one does but ig not
what online ide are you using?
you should be able to install python on a chromebook though
unless it's locked everything down
yea they locked down everything
how long did it take to run part two of day 6
3ms for me
mine's been going on for a while
milliseconds?
yeah
you need a different solution
u need to use a more efficient method
i did for part1 ๐
brute forcing it would need 12 terrabytes of ram lol
Terrabyte: noun, the amount of memory to store the entire Earth
(sorry, just being facetious with your spelling ๐ )
Let me know if you want a hint. i think i can give one without spoiling the whole solution
ill spend a bit on it thank you
3 seconds
.09s for both parts
yay i did it even though my solution was super stupid lol
wat
No more ram I did some naive solution where the list kept expanding
Man i really need optimization but I can't see how
terrabyte lol
theres lots of different ways to optimize it
i can give u a hint if u want
I think I've figured out the start if I consider the initial timer value and the number of days in total. Just need to see how I can organise that bottom-up approach.
The same method as private leaderboards, it's just that we combine 7 of them before we re-rank and re-score
Still wonder how they decide which is first between the 7 leaderboards
Does the website give back the timestamp of completion?
The website gives us completion time, we rank based on that
Yes, there's a JSON API
That makes it easy then
yup!
It's also how we're able to do our .aoc daystar command
@minor cave are you a person working on aoc?
PyDis private leaderboard JSON API: https://adventofcode.com/2021/leaderboard/private/view/631135.json
Damn
Other leaderboards can be found by changing the number at the end
(there's also just a button to get this link on the private leaderboard)
I run the Advent of Code event for this community specifically (i.e., I make sure we have all our leaderboards and bot features are up to date). That sometimes requires me to interface with the actual AoC organizers, but I'm not an AoC organizer myself
A person that is fast
Nice!
gj
i really hope part 2 is okay cause my head is on vacation today
It'll work out
it might work and also take 10 hours to calc
hehe ๐
i had this problem
you need a solid ram if you wanna apply the good old method
solid
||Several terabytes apparently||
||y-yeah good thing I interruped the process||
im guessing theres a way to do this with math?
||i decided to store the result in an over-expanding list otl||
i stopped my code from running. im sure my pc is happy for that
most of the people are using some numpy power matrix thingy
mkay ;O numpy is fast right?
u dont need to use numpy
depends on what you're doing with it
i don't think most people are doing it with ||linear operators||
even though that's technically a spoiler, the solution is so big-brained I don't know if I would consider it a real spoiler
whats this?
the solution most definitely doesn't have to be big brained, but one of the solutions definitely is. I'll ping you with it in the spoilers channel
there's some explanations of it in the spoilers channel if you search a bit
i ended up using a ||defaultdict for part1|| is that bad?
oo
nope, that's perfectly reasonable
cool, ||i learned about defaultdict and namedtuple in yesterdays challenge ๐ first time using it in Python||
so what do i do for part2 then? go eat some food while my pc goes into mountain climbing?
noe
my solution only took about ~10 seconds (when I upped the days to 1e6) to run for pt2 using a similar approach to yours (if I understood your approach correctly)
unless u make a 12 terrabyte swap file ur pc will run out of memory before its done
O.o
u need 2 be efficient
well basically i have a ||defaultdict with each day containing a list of the fishes||
You can make it simpler than that
with math? ๐
No
In fact I donโt think that the math approach yields a very good solution here (personally)
๐ค
Weekend problems are usually more involved
are you having problems with adding all the diagonal lines?
cough cough sea monster cough cough
i have everything correct except for 1 line
every single diagonal is fine but 1
Actually the funny thing about the math approach is that ||assuming that you have the eigenvalues|| you could theoretically compute todayโs by hand
0 1 . 1 . . . . 1 1 .
1 . 1 1 1 . . . 2 . .
2 . . 2 . 1 . 1 1 . .
3 . . . 1 . 2 . 1 . .
4 . 1 1 2 3 1 2 2 1 1
5 . . . 1 . 2 . . . .
6 . . 1 . . . 2 . . .
7 . 1 . . . . . 2 . .
8 1 . . . . . . . 2 .
9 2 2 2 1 1 1 . . . .
i keep getting a graph that looks like this with the example input
the eigenvalues and eigenvectors are all complex
Yeah
also really bad, 9th degree polynomial roots
Yep thatโs why I donโt like the mathy solution
i wish i knew how to tackle this days part 2. im tempted to open the spoilers channel soon
You should fish for some more hints before going straight into spoilers
im basically holding my fishing rod here, i need a big fish to bite on it with some juicy hint
how are you doing it at the moment btw?
i have a defaultdict that has each day as a key. it holds the fishes in a list
Is the list basically just how the input looks like at the moment?
Wait yeah what do the lists look like
yup
OK, so let me try a hint then
lantern_fish[18]
[6, 0, 6, 4, 5, 6, 0, 1, 1, 2, 6, 0, 1, 1, 1, 2, 2, 3, 3, 4, 6, 7, 8, 8, 8, 8]
||Typically you use a list for ordered data. Is the order of the data here important? If not, can you transform the data some other way instead?||
||tuples?||
or ||sets?||
||Tuples don't really solve your problem here. If you are going to use it as a list, then it's basically equivalent to a list in its advantages and drawbacks||
||i could use a dict containing the amount of fishes that has that value?||
||What would a set do for you? A set removes all duplicates - is that something that would be useful or not?||
YOOOOOOOO
I was going to be a bit more subtle than that lol
||yeah i even know that :D||
okay i think i got it
I donโt do subtlety sorry
yeah I could tell!
when my fishes start telling stories ๐
good thing i love fishes. i do love them as food on my plate tho, not in my code editor
D: fish are friends not food
I hope that someday AOC will be better for european timezone
Often, when part 2 is just part 1 but with more runs/bigger input/etc. there's a few techniques to think about
- Find the trick that means you don't need to do eleventy billion runs
or - Find the data structure that would allow you to have a faster solution
I mean, itโs really fine assuming that youโre not trying to lb
I feel your pain
hello can someone reccomend me a library which will help me make a screensaver?
i would like to try it someday
Lol elsewhere
Not the channel for that
im just tryna wake up at 6 am just to get stuck for 30 mins sometimes
on which chanell i can ask??
Iโm on the west coast so they open at 9 PM for me ๐
I finish them before bed
on which channel i can ask about that?
youre lucky :c
Beats me
I wanted to make the bot delete a message with a specific text, but if someone had a specific permission, it would not delete the message. How would I do this?
for me its six in the morning
๐
#discord-bots or something man
Actually try #โ๏ฝhow-to-get-help
thx
thing is
the problem aint really whether i need to wake up early or stay up late
the bigger problem is college
luckily i can finish most puzzles under an hour, but
Mood. Finals coming up for you too?
say, if something akin to y2020d20 happened, i could take more than just an hour which would mean i wouldnt be able to finish ti
altho maybe by then i wont even have to go
Kind Of
Today was last day of classes for me. I have a lab report due tomorrow and then finals
finals are next month, but there's a lot of assignments to do until the end of classes for this month
Oh man finals in January :/
All my finals are before Christmas
We start the new term in January
i wish the finals were at least early january
Where are you studying? US?
the equivalent to computer science in europe lol
leading towards a data science-y branch
Ah gotcha
Whenever I hear college I assume itโs American
Iโm studying physics in Canada :)
neat
Yes, I solved todays part 2 ๐
Kind of surprised I got it so quick though
todays one seemed easier than yesterdays
yeah even part 2 seemed easy at first, but when my code didn't stopp running after 1 minute, i figured it was more complex xD
im still waiting for it to finish running
Never take the whole "do the same thing a bunch more times/with a bigger input" at face value lol
i hope i dont have to change the code
It almost always means that, if you are doing the naive thing, you'll be in for a world of hurt
It's deliberately worded so you have to change the code lol
That's the point
To make you think about how you could do this in a non-naive way
Find the trick or find the more efficient solution - either of the two
i know how to do it now, im just so god damn tired. i might continue tommorow with fresh energy
gonna be the first day im not submitting both parts on the actual day. struggle of working in a kindergarden
I wonder at which point I'm not going to be able so solve it anymore
Last year Day 10 Part 2 made me give up
I will keep trying this year. Last year I started too late. I think it was a week before christmas
old me: oh the part 2 is easy, I'll just change the number of iterations from 80 to 256
PC: please don't
i added an iteration count so i can watch as the iterations get slower and slower
I let it get to 200 before I killed the process out of sympathy
i did this exact thing when i was making a video encoding thing
and it got SLOW
RIP
I went to 150 before I euthanised it
Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like. People use them as a speed contest, interview prep, company training, university coursework, practice problems, or to challenge each other. In this talk, the creator of Advent of ...
ERROR: Failed building wheel for numpy
Failed to build numpy
ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
rip
part 1: lmao so easy
part 2: naive input change? lmao so ea- oh fk wait a minute this is exponential growth and my shitty algo can't stand it
U don't need numpy to do the challenge
Whenever part 2 is just an increase in one number, thatโs almost always the issue
yeah, i'm trying to see if i can use math to solve this instead
The answer to that is โkind ofโ
One day I should sit down and do day 1 part 1 by hand.
I wonder how much my hand'd hurt
2000 inputs, good luck
You can do it with ||ctrl-F and regex search||
oh wait, was thinking of day3
nvm
this one would be easy
Day6 p2 is such a pain lol
Iโm trying to find the correct remainder for the days but
I canโt organize that in a recursive way
how do you mean, the correct "remainder"?
what remainder is that
Fishes donโt start spawning until a certain amount of days. Which would be 8 + initial timer
So my idea is, everytime a fish spawns, Iโd pick up the day it spawns, substract it to the total days (like 256), estimate the number of fishes it can spawn in that period then add it to the total
Are you ok with light hints, or do you want zero hints completely?
A hint please
Hint - you're overthinking it
true about life as well ๐
Should I use a top-down approach?
Still overthinking it
Try have a think about it for 5-10 mins, but try not to overthink it
if you are still stuck I'll give another hint ๐
Iโm using GoodNotes on iPad to lay down the issue but I canโt really copy the page like that to show my thought process
screenshot? I don't use iOS so idk
Yes please because the only idea I have rn is doing some 2 power of n
Alrighty
||The biggest issue with the naive approach of just using lists is that the list grows exponentially. But there's not much value to using a list here. A list contains ordered data - do you think that there's any ordered data here? If not, how could you transform this data into another format?||
||you mean, since we have finite values, we can sort them up in a dictionary or even a list with the corresponding indexes as keys?||
||the keys would be the timer values and the values would be the number of times each key would show up||
I am using spoiler tags here - but yeah, perhaps the last one was too much
Sorry if it wasnโt the appropriate place
any suggestions on how to not ran out of memory on a pc for day 6?
look at some of my spoiler comments above. I think I'll delete the last one though
oh thx
And yeah, if you have follow up questions, ping me on the spoilers channel
Just wrote a long-ass bit in my course evaluations flaming the CS course that I just took :)
what a shit course
i probably overthought everything... i was legit writing up recursive functions trying to calculate the number of fish that will spawn in each iteration and stuff
i should try another approach, today's puzzle is quite hard for me
You definitely overthought it lol
Would you like a hint?
only if i don't solve this in one more hour of tearing my hair out :P
thank you
!remind 1h is i love aoc bald?
Your reminder will arrive on <t:1638835280:F>!
lmfao ๐คฃ
this is a legitimate approach though
wat. well i can't get the recursion working and fiddle fontaine gave me a slight hint saying that's overthinking so
err the recursion, idk why the reply was something else
i didnt do it with recursion, but its possible and relatively simple
not necessarily easy though
Yeah I assumed they were thinking that they needed recursion
which is why I said they were overthinking it ๐
NO WAY
I'M ON A TRACK
IF THIS TRACK LEADS ME TO AN ABYSS I SHALL CRY
BUT I DON'T THINK SO
Looking like 1hr will be too much ๐
I'm imagining the track in Back to the Future 3
Do you ride the train into the modern day or fall into the canyon below ๐ค
MODERN DAY MODERN DAY MODERN DAY
NOW I NEED TO PROGRAM THIS TRACK INTO AN ACTUAL SOLUTION
๐ i have a recursive solution but 256 still taking a long time
13 minutes til hint lol
no need to remind me, the bot will ๐
oh no i'm just reminding myself that i have 10 more minutes until i officially end my aoc individual winning streak
aww ๐ฆ
scratch that; 0 minutes
.aoc join
Here's your reminder: is i love aoc bald?
[Jump back to when you created the reminder](#advent-of-code message)
turns out they were not @sleek cave ๐
woohoo :DDDDDDD
man, aoc is good
i've said this like 256 times already
but man, aoc is good
so good
so fun
256 times
I just realised why it's 256
hm?
oh
Here's your reminder: actually do this ๐
[Jump back to when you created the reminder](#advent-of-code message)
why would lanternfish be related to binary? or is it just a fun little arbitrary easter egg lol
arbitrary I'm sure
it's never arbitrary
I think that's because ||you can solve this with matrix multiplication, and if it's a straight power of two it's easier to do M = M * M (or equivalent) 8 times than to figure out the more general fast matrix exponentiation algorithm||
That's just a guess tho
Can it not just be that a byte has 256 values and 256 was also convenient for a "large" number of iterations ๐
๐คทโโ๏ธ
That (healthy) anger in me
I understand now that trying to wake up in the morning to do AoC
was intended
by the creator
I said in this channel doing AoC was the best decision of the year (because I learned so much in 5 days thanks to you guys <3)
bother that nonsense, I'm not waking up at 6 for fake internet points :P
Going back to the video ๐
1) 479 455 | 53.76% 51.07% 2) 438 427 | 49.16% 47.92% 3) 404 347 | 45.34% 38.95% 4) 303 284 | 34.01% 31.87% 5) 266 259 | 29.85% 29.07% 6) 253 235 | 28.40% 26.37%
\
\
\
v
unstonks.
๐
very unstonky indeed
:stinks:
idiot filters every weekend
Ooh I did Iโm good ๐ ๐
getting excited for today's :)
me too ima use dictionary comprehensions everywhere
return filter(idiot, weekend)
yes
smoort
everyone ready for day 7? >:3
sure ๐
hmm
im redy
only second time i'm awake for it
like uh
when doing day 6, it took like 60 seconds to run it for 80 days
then it took like
over 10 minutes to do it for one fish
lol
on 256
so i had to change my code a lot
:3
whats the time there guys
aoc day 7 starts on 12:00 PM for me
damn
15 more minnutes
Sorry, an unexpected error occurred. Please let us know!
ClientResponseError: 500, message='Internal Server Error', url=URL('http://snekbox.default.svc.cluster.local/eval')
!e print("im fine")
Sorry, an unexpected error occurred. Please let us know!
ClientResponseError: 500, message='Internal Server Error', url=URL('http://snekbox.default.svc.cluster.local/eval')
uh..
Yeah, not working right now sorry.
!ping
84.580 ms
Healthy
107.446 ms
weird
!e
print("hello world")```
Sorry, an unexpected error occurred. Please let us know!
ClientResponseError: 500, message='Internal Server Error', url=URL('http://snekbox.default.svc.cluster.local/eval')
Okay, just snekbox
any idea why?
Python is fine.
joe's working on it (#ot0-psvmโs-eternal-disapproval message)
Likely the k8s upgrade mangled snekbox a bit
who's joe ๐ /j
how exactly is this interpreter safe to use?
It's sandboxed
Sandboxed to oblivion essentialy
very. It runs subprocess in nsjail.
ah i see
what's a quick way to parse this kind of structure (related to a previous year aoc): txt aaa: b bb: aaaa b abc: aabc bdb dff bbbddf: ffff the format would many lines of key: value1 value2 ... for one or more values. I'm trying to find a one-liner regex for it but can't figure it out
i tried making something similair in my bot, but i didn't want to make use of the exec() function
It's a very carefully constructed ironbox of an nsjail running in a docker container
If you want to take a look, the source is available at https://git.pydis.com/snekbox.
does this act like an API?
So Python just does python -c your_code_here and sends that query off to snekbox to execute. At no point does our bot actually execute it
Btw, Advent of Code <t:1638853200:R> 
Yup!
that's true
ah so it just sends the given code into the request body
yeah
very cool
let me get my template ready, 1 sec...๐โโ๏ธ
Yeah, the docker container takes it in, nsjail executes the subprocess with fairly strict limits, and then we return any output
its 6 am in here
what is line limit for the given script
wait
11:51 pm here
same
p o g
thats below 0C?
barely above it
Mmmm, good question. I'm not sure, but if I were to guess I'd guess the discord limit of 2k
2F over 0C
equal to embed size?
dam
ig
lol
i am assuming that it would return a time out error if you just passed this in for example:
while True:
.....```
memory error
jail
Yup! We have timeout limits, memory usage limits, no internet connection, aaaand I think we limit to 2 or 3 processes (we allow more than one so people can illustrate threading/async/various)
๐
11:53 am here
same
lol
wait, you said pm
.aoc c
Day 7 starts <t:1638853200:R>.
5 minutes left but i cant do anything
also
gg
did your computer overheat on day 6
uh
no it didnt, somehow...
wait did you use the naive solution?
ur rich
no
nah i just saved the entire summer
plus some
without spending a thing
my god
didnt even give the correct answer
how did u save up
download ram
lucky
lol
Day 7 starts <t:1638853200:R>.
so close
download gta6 for free
python3.10 not in apt :(
apt?
rip school
The timing for aoc is completely unfair to me. Its 1030 and I need to do my job also ๐ซ
pff
use pyenv
sad
:('
aoc timings should be individual
.aoc c
Day 7 starts <t:1638853200:R>.
50
Then you get lots of copy pastas

oh wait deadsnakes ppa
there is no way to enforce individual timings
GL
hf
You can still solve at any time
gl
