#advent-of-code

1 messages ยท Page 43 of 1

stable heron
#

oof

stable shale
#

Im gonna do this in the morning when I have the brain capacity to do it

stable heron
#

ima do it rn

crystal shard
#

this seems easy

signal grotto
#

Mark my words I will have a beautiful object-oriented solution to this one too, but tomorrow ๐Ÿคฃ

stable shale
#

Hah

signal grotto
#

!remind 19h actually do this ๐Ÿ˜‚

marsh currentBOT
#
I'll allow it.

Your reminder will arrive on <t:1638835775:F>!

signal grotto
#

Nice code is also much easier to get right and also to debug

stable heron
#

yea it looks so neat too

stable shale
#

I've yet to use OOP except for yesterday's bingo

#

I'm just using horrible logic and for loops

brazen goblet
#

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)

woven solar
narrow crown
#

i wont be doing todays thing rn but how does it look so far

brazen goblet
regal garnet
narrow crown
#

thanks lol

hazy pendant
#

ez

stable heron
#

oh no my sol is going sooo slow after 30 days smh smh

blazing kraken
#

!remind 5h Do advent of code day 5 and day 6

marsh currentBOT
#
NEGATORY.

Sorry, you can't do that here!

stable heron
#

is it just slow or will it crash my comp

blazing kraken
#

!remind 5h Do advent of code day 5 and day 6

marsh currentBOT
#
Nah.

Sorry, you can't do that here!

blazing kraken
#

!remind 5h Do advent of code day 5 and day 6

marsh currentBOT
#
Not likely.

Sorry, you can't do that here!

blazing kraken
#

what

hazy pendant
#

#bot-commands

sinful pawn
#

it didn't work the first time, it's not gonna work the second or third time

deep ferry
#

im racing my friend

#

lol

blazing kraken
#

computing day 5 takes 2hours

#

lamo

stable heron
#

Hmmm I'm done with part one

#

part two ๐Ÿ˜ฉ

somber crow
#

^

bold needle
#

map's faster or recursion?

dense solstice
#

Took me longer to compute the result then it took for me to write the solution

#

kek

somber crow
#

Mine has been computing for 25 mins and counting

stable heron
#

if its taking > 15secs

wet current
dense solstice
#

Doesn't sound right

somber crow
hazy pendant
#

try to ||view the problem in a different prespective||

woven oriole
#

try to make a general form ๐Ÿ˜ฉ

brazen goblet
jade root
#

AAAAAAA part 2

#

part 2 hard ;n;

stable heron
#

yes goddamit

#

i can reach till 150

#

in okayish time

jade root
#

i am currently on 231 with the test input

#

practically frozen

frank maple
#

i liked this one

#

the runtime stuff is fun

summer kraken
#

My computer crashed in the second part..

jade root
#

same

frank maple
#

that happened to me in 2019 aoc

jade root
#

guys, can i get a lil hint? .w.

frank maple
#

i interrupted when i saw it was looong

woven sable
#

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

hollow wharf
violet raft
#

i dont get what the second part's asking

tight dune
violet raft
#

isn't the second part same thing as first, but different day number?

tight dune
#

it is

violet raft
#

oh, that's kind of dumb then

tight dune
frank maple
#

get ready with yer keyboard interrupt

tight dune
#

if you do it like most of us did you will hit your resource limits very fast

peak dock
summer kraken
frank maple
#

huehuehuehue

violet raft
#

hmm, i see

frank maple
#

i thought the same thing tho i was like wtf

pearl needle
#

the second part is a trap for those who did the first problem inefficiently/naively

summer kraken
#

And I fell in it.

tight dune
#

me 2

#

i waited for 20 minutes

#

waste of time smh

summer kraken
#

I literally solved first part in 10 minutes and wasted 40 minutes in the second one.

tight dune
#

me 2

simple bison
#

yeah...

#

6 00:02:52 63 38 00:43:12 5206 0

old basin
#

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?

peak dock
#

the latter

old basin
#

ok thanks

hollow wharf
#

course there are 5 years of old challenges, 50 per year, so you can take your pick

old basin
#

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?

dense solstice
#

Probably leetcode

hollow wharf
old basin
#

that search string returned 0 results but it's probably just a little string problem, I get the idea, that's excellent thnks!

woven sable
#

I did an O(n^2) solution for the first one

#

no even worse

#

I had to use ||dicts|| for the second part

pearl needle
#

it's exponential growth

woven sable
#

so would it be O(2^n)?

#

wai tthat doesn't make sense

pearl needle
#

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

old basin
#

wow leetcode also looks useful thanks @dense solstice

dense solstice
#

๐Ÿ‘

hollow wharf
#

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

stable heron
#

LMFAO

hollow wharf
#

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

hollow wharf
#

anyway I got a good enough algorithm. it's probably O(nlogn)

#

I think

hollow wharf
#

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
hazy pendant
#

ooo

#

the fish:

devout tusk
hollow wharf
#

which language?

devout tusk
#

python lol

devout tusk
hollow wharf
devout tusk
# hollow wharf Haskell

ohh damn. I learned it a bit but it's functional nature is like none other. Takes hella time to perfect

hollow wharf
#

trying to learn

tacit marsh
#

hello

ember cargo
#

Bro

#

I've been waiting 30 mins to compute part 2

hollow wharf
#

you'll likely need a new strategy

eternal forge
#

^ this ๐Ÿ˜„

#

Same position here hence || using lists i assume ||

ember cargo
#

Yeah

#

Whoops wrong channel sorry

iron reef
#

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

hollow wharf
#

also my solution for today is only 25 SLOC!

iron reef
#

oh if we're golfing python we can absolutely get this to a one liner

hollow wharf
#

if I wanted I could make this a one-liner too

wary veldt
#

helo guys me noob how do i solve aoc?

hollow wharf
#

I really don't understand day 3: part 1, can someone explain it?

next oyster
winter vigil
#

ok dumb question, but for day 6, how are they getting 26 for the total lantern fish?

#

in the sample output

cold ferry
#

run the simulation for 18 days, then count how many fish there are

hollow wharf
#

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

winter vigil
#

oof me, i was tallying only the new fish being born

#

sometimes i need to read

#

lol part 2 is a huge trap

iron reef
#

i just changed one number to get part 2

#

what's the trap

winter vigil
#

i changed one number too

#

but its taking forever lol

iron reef
#

it should be an O(n) operation

winter vigil
#

and n = # days elapsed

#

right?

iron reef
#

yeah

winter vigil
#

ok

iron reef
#

All other variables become irrelevant rapidly

winter vigil
#

oh i see

#

no wonder its soo slow lol, cuz the list is growing dynamically

iron reef
#

list shouldn't be growing

cold ferry
#

you probably shouldn't have a list that's growing...

#

the list will get too big for that

winter vigil
#

yes

#

part 2 made me realize that big time

#

my part 1 computed relatively quickly

peak dock
#

yeah, you'll have to change your approach for part 2 if you don't have terabytes of ram lying around

winter vigil
#

yea true

#

pycharm's memory usage was certainly spiking

#

think i left the script running for 5 minutes lol

hollow wharf
#

Today is cool

#

Forces people to take a different approach

eternal forge
woven oriole
#

haha knew someone would post this

dusk cove
#

192M lanternfish til now, still waiting...

iron reef
#

It's a trivial operation per day

hollow wharf
#

LMAO

hollow wharf
#

It's exponential so yeah

#

Good luck

#

See you in a few days

dusk cove
hollow wharf
#

I got 1'644'286'074'024 as result so you can do the maths

void ocean
hollow wharf
hollow wharf
iron reef
#

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

winter vigil
#

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?

hollow wharf
#

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

winter vigil
#

lol

#

i see

#

ofc i gotta use hashmaps

ember cargo
winter vigil
#

these lantern fish should be exterminated

mossy basin
ember cargo
#

||With .pop() etc?||

winter vigil
mossy basin
#

not the brute force method, a different list approach

winter vigil
#

ah gotcha

blazing kraken
#

Python is too slow, I does not compute day 6 part 2 for some reason

#

Anyway i can optomise it?

hollow wharf
ember cargo
# winter vigil ah gotcha

||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

ember cargo
#

But it would've taken months to get to 256

hollow wharf
winter vigil
#

if you kept track of it

ember cargo
#

๐Ÿ˜… a very big number, lemme see

winter vigil
#

its in the billions fs

ember cargo
#

Day 100: 2180834

#

Day 125: 19062620

#

And this is my old method btw, parsing every single elem in that list with if statements

hollow wharf
hollow wharf
#

1644286074024

blazing kraken
#

what can i do?

ember cargo
#

You gotta optimise it

blazing kraken
#

it kills the process right at 170

ember cargo
#

Yeah same

blazing kraken
iron reef
#

python isn't too slow to do this

peak dock
#

youll have to change your approach altogether

ember cargo
#

What you gotta do is ||make a list storing how many fish are at each stage instead of storing each individual fish||

blazing kraken
#

lemme try that

ember cargo
#

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]||

blazing kraken
#

what

ember cargo
iron reef
#

well that looked smaller in my program output

peak dock
#

uhhhh

#

could you sent that in a pastebin lol

iron reef
#

is there a discord shrink output tag

#

ok figured it out

peak dock
#

can i see my overall global rank somewhere pithink

#

there's a personal stats thing but it shows day-wise

pale heath
#

my code for part 2 of 6 is kinda slow

void ocean
#

"kinda"

pale heath
eternal forge
rancid creek
#

It says unofficial, but I got the link from Eric, so....

void ocean
#

I forgot if the fractional exponent is simplified in big-O

#

probably is

pale heath
#

I did it in simpler way

#

(not saying better)

#

||I just change range from 80 to 256||

hollow wharf
#

today was diiiiiirty

hollow wharf
#

.aoc join

#

I wonder

#

.aoc link Akarys42

hidden copperBOT
hollow wharf
#

well, yes and also no

void ocean
#

it's not proportional by a constant

hollow wharf
#

you should remove the constant I believe

void ocean
#

it's not proportional by a constant though

#

it's root 8 of 2^n

hollow wharf
#

it is O(2^(C*n)) where C = 1/7, C should be removed so you get O(2^n), right?

proud cosmos
#

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

hollow wharf
#

2^(2n) is equivalent to 2^n in Big-O, right?

proud cosmos
#

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

woven solar
#

but log_b(n) is the same big-O regardless of b

woven solar
#

I see people sometimes insist on saying, say, O(log2(n)) - that's silly, the logarithms are all equal

proud cosmos
#

Yeah cause you can replace them all with ln divided by a constant

#

Making it equivalent hmmmm

woven solar
#

yup

hollow wharf
#

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

proud cosmos
#

1e6 took me 6 seconds I believe

#

No logging though

#

Logging should slow it down a lot

woven solar
#

1s for 1 million days for mine

void ocean
#

You can't express 2^(n/8) as C*(2^n)

hollow wharf
#

Right, makes sense

#

I'll try without logging during the English class hehe

loud yew
#

people are using big-O notation, something horrifying must be happening

hollow wharf
#

Hahaha

loud yew
#

anyway, i decided to use a deque and tqdm, and (so far) it is fairly performant...

eternal forge
#

First solution was || looping over each number with another loop inside with each day , yikes on me ||

loud yew
#

oh haha my part one solution finished in under a second

quaint hare
#

the pattern is making a lot more sense now

devout tusk
# quaint hare

for now it looks like a dude peeing on an ascent to me

quaint hare
#

oh god

dusk ibex
#

just finished day 6!

#

:D

hollow wharf
#

I wonder if we moved up into the leaderboard yet

#

.aoc lb

hidden copperBOT
#

:x: Please use #aoc-bot-commands for aoc commands instead.

hollow wharf
#

thanks

sleek cave
#

today's aoc seems simple enough, or maybe appearances are deceiving

hollow wharf
#

yay we did

hollow wharf
sleek cave
#

just woke up lmao

#

guess part 2 escalates like day 3

hollow wharf
#

part two is ||really really similar|| (minor spoil)

dusk ibex
#

yeah for me it wasn't because I used a list for the first one

#

and appending and stuff

hollow wharf
#

WOW

bright spindle
#

26 seconds for a million days

hollow wharf
#

2.8s for one million days

dusk ibex
#

it was slow as hell in the 2cnd one

hollow wharf
#

2 minutes with printing

#

that's craaaaazy

bright spindle
hollow wharf
#

Python, using a list

#

I'll send my code in the spoiler chat

woven oriole
#

how did you manage it not grow exponentially

hollow wharf
dusk ibex
#

in python

#

i used a dictonary

frosty bronze
#

Who keeps pinging me

bright spindle
#

If you're subscribed.

digital ember
#

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

frosty bronze
signal grotto
#

There is, but these messages are sent in this channel this

frosty bronze
#

Ah gotcha

torpid karma
#

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

dusk cove
wispy burrow
#

nice!

torpid karma
fluid zealot
#

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

humble copper
#

are we meant to assume that the puzzle input for day 6 pt 1 is the first "day"?

sonic silo
#

the first day, yes

#

just like in the sample

rotund rapids
#

No, you have your puzzle input just like any other day

humble copper
#

damn that was quick

tight dune
#

nice!

hollow wharf
#

Took me 14 minutes to do both parts today

#

short and sweet

humble copper
#

way easier than yesterdays

hollow wharf
#

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

pale heath
#

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

tropic forge
woven oriole
#

๐ŸŒŸ typehint ๐ŸŒŸ

pale heath
#

Day 256

woven oriole
#

nice visualization of growth

brittle mauve
#

I gotta catch up on advent of code

#

I skipped 3 but i gotta do 4, 5, and 6

woven oriole
#

yeah lol

hollow wharf
#

guys how to settle it

bright spindle
#

This channel is for discussion of the Advent of Code event. If you need help with bot development, head to #discord-bots.

tight dune
steep shard
#

does anyone know a good online python ide thing

#

the one im using doesnt give me enough resources to do todays challenge

velvet stag
#

like ram?

steep shard
#

idk it just times out before its done

hidden musk
#

you should try to find a more efficient method

unique osprey
hidden musk
#

the number of fish grows exponentially, the answer is on the order of trillions

steep shard
#

hmm

#

okay

steep shard
#

1-80 took less than a second to compute

unique osprey
#

yup

minor cave
#

there's even a warning ๐Ÿ˜”

steep shard
#

hm

#

okay

#

thx

hidden musk
#

it's fairly easy to convince yourself of that

dusk cove
bright spindle
dusk cove
peak dock
#

lmao

bright spindle
#

When the dolphins escaped Earth, they were like "So long and that's too much fish, cool it with all the fish, alright?"

steep shard
low condor
#

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

woven oriole
#

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 ducky_devil if you break down each function call and what is happening

minor cave
woven oriole
#

oop

ember cargo
#

Oreo can you send me your code I wanna see it

woven oriole
#

F

minor cave
#

thank you~

woven oriole
#

i was mistaken , i though it was spoiler channel ๐Ÿฅด

plush agate
steady rune
#

||they really said "solve the collatz conjecture" :trol:||
(may be misinterpreting the mission)

woven oriole
ember cargo
#

I've done it ||with a list of how many at each stage||

#

I'm just curious how you'd do it with ||recursion||

woven oriole
ember cargo
#

Kk

steep shard
#

idk why u guys focusing on this so much just make a 12 terrabyte swap file ๐Ÿ™„

bright spindle
woven oriole
#

logic is inversely proportional to size

#

๐ŸŒŸ

bright spindle
woven oriole
#

cleverness

#

i mean better logic

#

lol

bright spindle
#

And "size"?

#

Memory usage?

woven oriole
#

yes

#

or

#

runtime

#

:P

bright spindle
#

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.

woven oriole
#

exactly

#

but i would take runtime as the priority

#

since the tradeoff is not too subtle

steep shard
#

i hate online ides

#

i had the solution

#

and then the web page broke

#

and now i have to restart

robust heart
#

So the step would be... find a link between the initial step, number of days and the population?

unique osprey
#

and don't most of them have a save function?

steep shard
#

im using an online ide because im on my school chrome book rn

#

i cant download python on it

unique osprey
#

gotcha

steep shard
#

and i thought this one does but ig not

gleaming token
#

what online ide are you using?

unique osprey
#

you should be able to install python on a chromebook though

#

unless it's locked everything down

steep shard
#

yea they locked down everything

uneven hollow
#

how long did it take to run part two of day 6

unique osprey
#

3ms for me

uneven hollow
#

mine's been going on for a while

uneven hollow
unique osprey
#

yeah

unique osprey
steep shard
uneven hollow
#

so you didn't brute force it

#

ah

#

ok

unique osprey
#

i did for part1 ๐Ÿ˜„

steep shard
#

brute forcing it would need 12 terrabytes of ram lol

uneven hollow
#

ok

#

let me check

#

hmmmm

unique osprey
#

(sorry, just being facetious with your spelling ๐Ÿ˜„ )

unique osprey
uneven hollow
#

ill spend a bit on it thank you

pale heath
gleaming token
#

.09s for both parts

robust heart
#

haha shit

#

I think my memory exploded

steep shard
#

yay i did it even though my solution was super stupid lol

steep shard
robust heart
#

Man i really need optimization but I can't see how

steep shard
#

i can give u a hint if u want

robust heart
marble minnow
#

hows the score calculated

#

on aoc lb

minor cave
#

The same method as private leaderboards, it's just that we combine 7 of them before we re-rank and re-score

proud cosmos
#

Still wonder how they decide which is first between the 7 leaderboards

#

Does the website give back the timestamp of completion?

minor cave
#

The website gives us completion time, we rank based on that

earnest forge
proud cosmos
#

That makes it easy then

minor cave
#

yup!

proud cosmos
#

Was wondering how you can possibly know who is faster

minor cave
#

It's also how we're able to do our .aoc daystar command

marble minnow
#

@minor cave are you a person working on aoc?

earnest forge
proud cosmos
#

Damn

earnest forge
#

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)

minor cave
#

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

marble minnow
#

good to know :)

#

wondering who Oliver Ni is

proud cosmos
#

A person that is fast

junior hinge
proud cosmos
#

Nice!

marble minnow
#

gj

junior hinge
#

i really hope part 2 is okay cause my head is on vacation today

proud cosmos
#

It'll work out

marble minnow
#

it might work and also take 10 hours to calc

junior hinge
#

hehe ๐Ÿ˜„

marble minnow
#

i had this problem

robust heart
#

you need a solid ram if you wanna apply the good old method

proud cosmos
#

solid

minor cave
junior hinge
#

rofl

#

my pc is making sounds i havent heard before

robust heart
marble minnow
#

idk, my code wasnt using ram at all

#

just around 9% CPU

junior hinge
#

im guessing theres a way to do this with math?

robust heart
junior hinge
#

i stopped my code from running. im sure my pc is happy for that

marble minnow
junior hinge
#

mkay ;O numpy is fast right?

steep shard
#

u dont need to use numpy

minor cave
mossy basin
minor cave
steep shard
#

wait the solution is suposed to be big brained

#

my solution was so stupid

minor cave
#

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

mossy basin
#

there's some explanations of it in the spoilers channel if you search a bit

junior hinge
#

i ended up using a ||defaultdict for part1|| is that bad?

steep shard
#

oo

mossy basin
junior hinge
#

so what do i do for part2 then? go eat some food while my pc goes into mountain climbing?

steep shard
#

noe

minor cave
steep shard
#

unless u make a 12 terrabyte swap file ur pc will run out of memory before its done

unkempt cargo
#

O.o

steep shard
#

u need 2 be efficient

junior hinge
hollow wharf
junior hinge
#

with math? ๐Ÿ™‚

hollow wharf
#

In fact I donโ€™t think that the math approach yields a very good solution here (personally)

junior hinge
#

๐Ÿค”

steep shard
#

i cant get the second part of day 5 doen

#

day 5 is way harder then todays

hollow wharf
#

Weekend problems are usually more involved

junior hinge
low condor
steep shard
#

every single diagonal is fine but 1

hollow wharf
#

Actually the funny thing about the math approach is that ||assuming that you have the eigenvalues|| you could theoretically compute todayโ€™s by hand

steep shard
#
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

woven solar
#

the eigenvalues and eigenvectors are all complex

woven solar
#

also really bad, 9th degree polynomial roots

hollow wharf
sonic silo
#

quite a shame

#

today's puzzle was surprisingly profound

junior hinge
#

i wish i knew how to tackle this days part 2. im tempted to open the spoilers channel soon

low condor
junior hinge
#

im basically holding my fishing rod here, i need a big fish to bite on it with some juicy hint

low condor
junior hinge
low condor
#

Is the list basically just how the input looks like at the moment?

hollow wharf
#

Wait yeah what do the lists look like

junior hinge
#

yup

low condor
#

OK, so let me try a hint then

junior hinge
#

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]

low condor
# junior hinge yup

||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?||

low condor
# junior hinge ||tuples?||

||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||

junior hinge
low condor
# junior hinge or ||sets?||

||What would a set do for you? A set removes all duplicates - is that something that would be useful or not?||

low condor
junior hinge
#

okay i think i got it

hollow wharf
low condor
junior hinge
#

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

hollow wharf
#

D: fish are friends not food

marble minnow
#

I hope that someday AOC will be better for european timezone

low condor
#

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
hollow wharf
tiny vigil
#

hello can someone reccomend me a library which will help me make a screensaver?

marble minnow
hollow wharf
#

Lol elsewhere

marble minnow
#

cuz it takes me 5 minutes for part 1

#

usually

sonic silo
tiny vigil
#

on which chanell i can ask??

hollow wharf
#

I finish them before bed

tiny vigil
sonic silo
#

youre lucky :c

hollow wharf
livid pendant
#

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?

marble minnow
#

for me its six in the morning

hollow wharf
#

๐Ÿ™ƒ

livid pendant
#

ah

#

sorry

#

wrong chat

tiny vigil
sonic silo
#

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

hollow wharf
sonic silo
#

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

sonic silo
hollow wharf
#

Today was last day of classes for me. I have a lab report due tomorrow and then finals

sonic silo
#

finals are next month, but there's a lot of assignments to do until the end of classes for this month

hollow wharf
#

All my finals are before Christmas

#

We start the new term in January

sonic silo
#

i wish the finals were at least early january

hollow wharf
sonic silo
#

the equivalent to computer science in europe lol

#

leading towards a data science-y branch

hollow wharf
#

Whenever I hear college I assume itโ€™s American

#

Iโ€™m studying physics in Canada :)

sonic silo
#

neat

restive imp
#

Yes, I solved todays part 2 ๐Ÿ™‚
Kind of surprised I got it so quick though

craggy wraith
#

todays one seemed easier than yesterdays

restive imp
#

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

craggy wraith
#

im still waiting for it to finish running

low condor
craggy wraith
#

i hope i dont have to change the code

low condor
#

It almost always means that, if you are doing the naive thing, you'll be in for a world of hurt

low condor
#

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

junior hinge
#

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

restive imp
#

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

steep shard
#

never give up

#

just kuz 1 day is hard for u doesnt mean the rest will be

restive imp
#

I will keep trying this year. Last year I started too late. I think it was a week before christmas

dusk cove
#

old me: oh the part 2 is easy, I'll just change the number of iterations from 80 to 256
PC: please don't

craggy wraith
#

i added an iteration count so i can watch as the iterations get slower and slower

minor cave
#

I let it get to 200 before I killed the process out of sympathy

craggy wraith
#

i just realised i was using the test case

#

not the real one

loud yew
#

and it got SLOW

low condor
#

I went to 150 before I euthanised it

devout tusk
#

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 ...

โ–ถ Play video
craggy wraith
#
  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

sleek cave
#

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

steep shard
hollow wharf
sleek cave
#

yeah, i'm trying to see if i can use math to solve this instead

hollow wharf
sharp panther
#

One day I should sit down and do day 1 part 1 by hand.

#

I wonder how much my hand'd hurt

sleek cave
sharp panther
#

exactly

#

it'll be fun!

unique osprey
#

oh wait, was thinking of day3

#

nvm

bleak sable
robust heart
#

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

low condor
#

what remainder is that

robust heart
#

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

low condor
#

Are you ok with light hints, or do you want zero hints completely?

low condor
#

Hint - you're overthinking it

devout tusk
robust heart
#

Should I use a top-down approach?

low condor
#

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 ๐Ÿ™‚

robust heart
#

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

low condor
#

screenshot? I don't use iOS so idk

robust heart
#

Here goes

low condor
#

Want another hint?

robust heart
#

Yes please because the only idea I have rn is doing some 2 power of n

low condor
#

Alrighty

low condor
robust heart
#

||the keys would be the timer values and the values would be the number of times each key would show up||

rocky oar
low condor
robust heart
#

Sorry if it wasnโ€™t the appropriate place

tidal locust
#

any suggestions on how to not ran out of memory on a pc for day 6?

low condor
tidal locust
#

oh thx

low condor
#

And yeah, if you have follow up questions, ping me on the spoilers channel

hollow wharf
#

Just wrote a long-ass bit in my course evaluations flaming the CS course that I just took :)

#

what a shit course

sleek cave
#

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

low condor
low condor
sleek cave
#

thank you

low condor
marsh currentBOT
#
Absolutely!

Your reminder will arrive on <t:1638835280:F>!

sleek cave
#

lmfao ๐Ÿคฃ

topaz summit
sleek cave
topaz summit
#

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

low condor
#

Yeah I assumed they were thinking that they needed recursion

#

which is why I said they were overthinking it ๐Ÿ™‚

sleek cave
#

NO WAY

#

I'M ON A TRACK

#

IF THIS TRACK LEADS ME TO AN ABYSS I SHALL CRY

#

BUT I DON'T THINK SO

low condor
#

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 ๐Ÿค”

sleek cave
#

MODERN DAY MODERN DAY MODERN DAY

#

NOW I NEED TO PROGRAM THIS TRACK INTO AN ACTUAL SOLUTION

sleek cave
#

๐Ÿ˜” i have a recursive solution but 256 still taking a long time

#

13 minutes til hint lol

low condor
sleek cave
low condor
#

aww ๐Ÿ˜ฆ

sleek cave
little siren
#

.aoc join

marsh currentBOT
low condor
sleek cave
#

man, aoc is good

#

i've said this like 256 times already

#

but man, aoc is good

#

so good

#

so fun

hidden musk
#

256 times

low condor
#

I just realised why it's 256

hidden musk
#

hm?

low condor
#

256 iterations in part 2

#

binary reference

#

tl;dr I'm dumb

hidden musk
#

oh

marsh currentBOT
sleek cave
low condor
#

arbitrary I'm sure

hidden musk
#

it's never arbitrary

wooden jewel
#

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

low condor
#

Can it not just be that a byte has 256 values and 256 was also convenient for a "large" number of iterations ๐Ÿ˜‚

wooden jewel
#

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

humble escarp
#

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)

wooden jewel
#

bother that nonsense, I'm not waking up at 6 for fake internet points :P

humble escarp
#

Going back to the video ๐Ÿ˜›

sleek cave
#
 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.

hidden musk
#

๐Ÿ“‰

tight dune
#

very unstonky indeed

sinful pawn
#

:stinks:

hazy pendant
#

idiot filters every weekend

signal grotto
hollow wharf
#

getting excited for today's :)

frank maple
#

me too ima use dictionary comprehensions everywhere

rancid creek
hazy pendant
#

yes

uneven hollow
hollow wharf
#

everyone ready for day 7? >:3

signal grotto
#

sure ๐Ÿ˜‚

hollow wharf
#

hmm

velvet stag
#

im redy

hollow wharf
#

day 6 killed my laptop at first

#

because i was brute forcing it

#

lol

velvet stag
#

only second time i'm awake for it

hollow wharf
#

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

woven oriole
#

whats the time there guys

steel oyster
woven oriole
#

oh cool

#

ig many of them have midnight ++ due to timezone diff

hollow wharf
#

:3

#

12:00 am for me

#

lol

#

EST timezone go brrr

woven oriole
#

damn

winter vigil
#

man i just learned about defaultdicts today

#

they are a god send

steel oyster
#

15 more minnutes

hollow wharf
#

they're interesting

#

also is @marsh current busted rn?

#

!e print("hi")

marsh currentBOT
#

Sorry, an unexpected error occurred. Please let us know!

ClientResponseError: 500, message='Internal Server Error', url=URL('http://snekbox.default.svc.cluster.local/eval')

steel oyster
#

!e print("im fine")

marsh currentBOT
#

Sorry, an unexpected error occurred. Please let us know!

ClientResponseError: 500, message='Internal Server Error', url=URL('http://snekbox.default.svc.cluster.local/eval')

steel oyster
#

uh..

north silo
#

Yeah, not working right now sorry.

minor cave
#

!ping

marsh currentBOT
#
Pong!
Command processing time

84.580 ms

Python Discord website status

Healthy

Discord API latency

107.446 ms

hollow wharf
#

weird

winter vigil
#

!e

print("hello world")```
marsh currentBOT
#

Sorry, an unexpected error occurred. Please let us know!

ClientResponseError: 500, message='Internal Server Error', url=URL('http://snekbox.default.svc.cluster.local/eval')

minor cave
#

Okay, just snekbox

hollow wharf
#

any idea why?

minor cave
#

Python is fine.

sharp panther
minor cave
#

Likely the k8s upgrade mangled snekbox a bit

hollow wharf
#

who's joe ๐Ÿ‘€ /j

winter vigil
#

how exactly is this interpreter safe to use?

hollow wharf
#

they disabled like everything you could break it with

#

lol

north silo
minor cave
sharp panther
winter vigil
pearl needle
#

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

winter vigil
#

i tried making something similair in my bot, but i didn't want to make use of the exec() function

minor cave
#

It's a very carefully constructed ironbox of an nsjail running in a docker container

sharp panther
minor cave
#

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

north silo
#

Btw, Advent of Code <t:1638853200:R> BongoCat

minor cave
sonic silo
#

en solo 12 mins :o

#

damn its cold

hollow wharf
#

that's true

winter vigil
sharp panther
#

yeah

hollow wharf
#

very cold

#

lol

winter vigil
#

very cool

steel oyster
#

let me get my template ready, 1 sec...๐Ÿƒโ€โ™‚๏ธ

minor cave
sonic silo
winter vigil
sonic silo
#

wait

hollow wharf
sonic silo
#

thats 35 F

#

uhh

steel oyster
hollow wharf
sonic silo
#

thats below 0C?

hollow wharf
minor cave
hollow wharf
#

2F over 0C

woven oriole
#

equal to embed size?

sonic silo
#

dam

woven oriole
#

ig

hollow wharf
#

lol

winter vigil
#

i am assuming that it would return a time out error if you just passed this in for example:

#
while True:
  .....```
woven oriole
#

memory error

hollow wharf
#

something definitely happens

#

lol

woven oriole
hazy pendant
#

jail

minor cave
hazy pendant
#

๐Ÿ’€

hollow wharf
#

lol

#

can't use requests or anything

hazy pendant
hollow wharf
hazy pendant
#

no

#

i'm in am

#

you're in pm

hollow wharf
#

oh

#

i misread

#

lol

hazy pendant
#

lol

steel oyster
minor cave
#

.aoc c

hidden copperBOT
#

Day 7 starts <t:1638853200:R>.

narrow crown
#

5 minutes left but i cant do anything

hollow wharf
#

yo-

#

:3

narrow crown
#

lesgo

#

still hsvent read day 5 cuz school

hollow wharf
#

awh

#

i'm sorry

hazy pendant
#

also

late frigate
#

gg

hazy pendant
#

did your computer overheat on day 6

hollow wharf
steel oyster
hollow wharf
#

:3

winter vigil
hazy pendant
steel oyster
winter vigil
#

with the growing list

#

oh

#

interesting

hollow wharf
#

plus some

#

without spending a thing

hazy pendant
#

my god

steel oyster
narrow crown
#

how did u save up

mystic plover
hollow wharf
#

and not having expenses

narrow crown
#

lucky

hollow wharf
#

lol

narrow crown
#

oh yeah tax fraud

#

as a child

hollow wharf
#

:3

#

lol

hollow wharf
#

.aoc c

hidden copperBOT
#

Day 7 starts <t:1638853200:R>.

hollow wharf
#

so close

narrow crown
#

download gta6 for free

hazy pendant
#

python3.10 not in apt :(

hollow wharf
#

apt?

narrow crown
#

rip school

jade atlas
#

The timing for aoc is completely unfair to me. Its 1030 and I need to do my job also ๐Ÿ˜ซ

hollow wharf
#

pff

stable heron
stable heron
#

aoc timings should be individual

steel oyster
#

.aoc c

hidden copperBOT
#

Day 7 starts <t:1638853200:R>.

woven oriole
#

50

jade atlas
#

Then you get lots of copy pastas

north silo
hazy pendant
pearl needle
#

there is no way to enforce individual timings

jade atlas
#

GL

tulip elbow
#

hf

signal grotto
prisma sundial
#

gl

woven oriole
#

smh

magic bridge
#

in my time