#advent-of-code

1 messages ยท Page 44 of 1

woven oriole
#

15

stable heron
#

10 seconds

steel oyster
#

10 secconds....

earnest forge
#

GLHF

hazy pendant
#

10s

winter vigil
#

6

woven oriole
#

5

stable heron
#

2

#

1

sinful pawn
#

ngl, this emoji looks too much like a thumb

hidden copperBOT
winter vigil
#

hf

magic bridge
#

well i can still attempt day 5 right and its delayed due to school

hollow wharf
#

good morning PES_OhDear

warm grail
#

sure

winter vigil
#

seems like day 7 is a dfs min question?

velvet stag
#

49th global

#

peak aoc

stable heron
#

YES DONE

#

mafs

iron reef
#

Dammit even when I find the time to log in at reset time I'm second to the oliver ni guy

#

well hopefully at least I made ground on everyone else

regal garnet
#

I think I got a good solution but its gonna have to wait intil tomorrow

signal grotto
#

boom done

ivory ravine
sonic silo
#

damn it

winter vigil
#

lol damn

#

that was easy

sonic silo
#

i really have the idea but im not sure how to execute it

ivory ravine
narrow crown
#

nooo this one was easy i couldve done it

#

rip math hw

sonic silo
#

i dont understand...

hollow wharf
#

yay i made it to 3 days!

hazy pendant
#

i got two stars!

mystic plover
#

yo i did part 1

hazy pendant
#

in 14 minutes :(

marble minnow
#

It's my first aoc and I am wondering if the rest of questions will be also short?

#

Or will we get something complex to solve

hazy pendant
#

weekends:

quartz crest
#

damn aoc is down?

hazy pendant
quartz crest
#

the leaderboard pages

uneven hollow
#

today's was easy

quartz crest
#

ikr

hazy pendant
#

damn those users are f a s t

#

i'm envy

uneven hollow
hazy pendant
#

leaderboard

#

ah

#

i was looking at public leaderboard

#

welp time to uninstall python3.9

summer kraken
#

It was ez today..

uneven hollow
#

yeah

summer kraken
#

kind og

uneven hollow
#

i just brute forced

summer kraken
#

Hey... is the advent of code site crashed or unresponding?

outer chasm
#

Hmm that was actually alright

hollow wharf
#

i seem to have misread something in the instructions

#

lol

hazy pendant
#

uninstalls python3.9

#

installs python3.10

#

relief

uneven hollow
#

lol

#

let me install 3.10

hazy pendant
hollow wharf
#

i was missing a +1

#

lol

summer kraken
hazy pendant
#

no

uneven hollow
hollow wharf
#

i think

#

we'll see

hazy pendant
#

i will install python3.10

summer kraken
#

ok..

hazy pendant
#

you can't stop me

#

distutils.util

#

oh no

mystic plover
#

guys is there a cool way to do p2

#

wait no wrong chat

winter vigil
#

sooo lost on why this isn't working

#
for test in positions:
    fuel_cost_total = 0
    for pos in positions:
        steps = abs(pos-test)
        cost = sum([i for i in range(1,steps+1)])
        fuel_cost_total+=cost

    fuel_sums.append(fuel_cost_total)

print(min(fuel_sums))```
hazy pendant
stable heron
#

||you're just going through the different inputs||

hazy pendant
#

and yes i installed python3.10-full instead of python3.10

stable heron
#

||the most efficient horizontal position is not necessarily in the input||

winter vigil
#

i can't read instructions lol

topaz summit
clever pecan
#

this was so much easier then yesterday

summer kraken
#

It was much computer-friendly than yesterday.

void ocean
#

yeah it's an off-day

stable heron
#

which is probably why the website went down pithink

signal grotto
#

hi, lil PSA: yes there are site issues. yes the folks behind the site are aware. yes they're looking into it. no eta or anything else right now :)

humble copper
#

difficulty is not balanced at all

signal grotto
humble copper
#

literally easier than yesterdays, much easier than the day before that

void ocean
#

there are some off days to control pacing and prevent burnout

signal grotto
#

also weekends are harder on purpose

steel oyster
#

ok day 7 done

winter vigil
#

just finished too

humble copper
#

wait just for future reference

#

is having this happen an indication of something not being done optimally

winter vigil
#

51% cpu just from a python script

#

damn

humble copper
#

no its 31.3

winter vigil
#

it could mean that?

humble copper
#

51% total

winter vigil
#

oh yea read wrong

#

well python was taking up 90% of my memory yesterday from my list with like billions of elements

sinful agate
#

me when list(permutations(inp, len(inp)))

covert arrow
#

.aoc join

velvet knot
#

Thought I was done after the bingo one

#

But 5,6 and 7 were pretty chill

tame kiln
#

.aoc join

earnest forge
violet raft
#

hello, could someone give me a hint on whats wrong with my code for lanternfish part 2

velvet stag
#

both parts are the same

#

if it worked for 1, it's still correct

violet raft
#

i had memory error when using same method for first part

covert arrow
#

try optimising it

hollow wharf
covert arrow
#

yes

hollow wharf
#

double ||

#

||or /spoiler seems to work||

violet raft
#

ok, thx i have an idea of ||memoization|| hopefully that works

thick talon
#

hi why does this

x = ['00100', '11110', '10110', '10111', '10101', '01111', '00111', '11100', '10000', '11001', '00010', '01010']

for i in x:
    print(i)
    if i[0] == '0':
        x.remove(i)
print(x)
``` output ['11110', '10110', '10111', '10101', '00111', '11100', '10000', '11001', '01010'] instead of ['11110', '10110', '10111', '10101', '11100', '10000', '11001']
#

this is for the binary diagnostic part 2

eternal berry
#

Hi, I had the same problem. When you remove an element from a list, each elements index shifts -1. So if i = 2, and you remove 2, the element in index 3 becomes index 2

stable heron
#

removing items from lists while iterating it

#

not a good idea

#

nu uh

eternal berry
#

Easiest way around it that I found was to do:

for i in reversed(x):
thick talon
stable heron
#

do the removal on a copy of the list

#

or

#

hmm

eternal berry
#

We don't care about the order of the elements in this case, so reverse works well

sinful pawn
thick talon
stable heron
#

i forgot how i did this one

thick talon
sinful pawn
#

instead: y = x.filter(lambda s: s[0] != "0")

eternal berry
thick talon
stable heron
#

yes

sinful pawn
#

keep if true, toss if false

thick talon
pale heath
#

at least today was easy

sinful pawn
#

LMAO I'm still stuck on day 4

#

I've been putting it off

#

I'm scared of 3D arrays

eternal berry
#

I'm having a weird issue with the same problem. Day 3 solution 2. I've worked out oxygen. Co2 is the same but the other way round, however when i'm indexing through the binary list, it gets to index 8 and I have 3 binaries left. At index 9, I have an empty list ๐Ÿ˜ฆ

thick talon
eternal berry
#

Yeah. I have a condition, but when I get to index 9, each binary left in the list has the same bit, so they're all removed

#

Everything worked fine for oxygen list though, so I must have screwed up somewhere.

stable heron
#

im stuck on day 20 of aoc 2015 ๐Ÿ˜”

#

i need to find n prime numbers such that their sum is >= x and they have the least product ๐Ÿ˜ฉ

thick talon
#

@sinful pawn

stable heron
#

try list(filter(lambda s: ..., x))

sinful pawn
#

I'm used to Nim

thick talon
#

do i put filter before

#

the x

sinful pawn
#

huh?

stable heron
thick talon
eternal berry
#

1 is the least common bit at index 9, so all my binaries are going to be removed from my list ๐Ÿ˜ฆ

#

I'm so confused

thick talon
eternal berry
#

Why would only the second element be removed?

#

Ah sorry, my screenshot is misleading

velvet stag
#

yeah all should be removed, if it's second thing

eternal berry
#

so the next step in the loop is to remove all strings with a 0 at index 9, which is all strings

velvet stag
#

probably went wrong on some previous step

eternal berry
#

I don't understand how i've managed to get to this position though. My loop looks to do exactly what it's meant to do, and it worked perfectly for oxygen (or atleast I think it did)

velvet stag
#

not sure

thick talon
#

did u take that into consideration

velvet stag
#

there's 50% chance you just got that wrong yourself

#

yep, it says the opposite

#

personally I just tried all 4 ways

#

got it wrong thrice

#

make sure you're counting left to right

eternal berry
#

So here's another screenshot to give some context:
index is the index of the binary. position is how many 1's are in each index position.

As you can see in index 9, there are 478 1's, which means 1 is the least common bit as it's < 500

#

Yeah it's counting left to right, i've been watching as it debugs. I may just open a new help channel at this point. It's almost as if my puzzle data is wrong ๐Ÿ˜„

velvet stag
#

?

#

don't compare with 500

#

do it normally smh

eternal berry
#

I have 1000 elements in my puzzle data, so I did (len(puzzle_data)/2) to get my threshold so to speka

velvet stag
#

yeah, that would produce wrong result

eternal berry
#

so if 1 or 0 >= (len(puzzle_data)/2), then that is the most common bit in that index position

velvet stag
#

instead get a new, less wrong threshold after you filtered the numbers on each step

thick talon
#

and see if that works

eternal berry
#

Ohhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

#

...

#

Massive oversight on my part ๐Ÿ˜„

sonic silo
#

i wonder if its possible to extract the sample quickly from the webpage

thick talon
eternal berry
velvet stag
thick talon
eternal berry
winter vigil
#

what day do you guys think will the first recursion heavy problem?

sonic silo
velvet stag
#

friday

tight dune
#

oops wrong server

peak dock
#

hmm the personal stats page is still down

jade atlas
#

.aoc stats

hidden copperBOT
#

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

sinful pawn
#

oh yay, that's a thing

eternal berry
#

Day 3 complete. That was a tough one ๐Ÿ˜„

weak torrent
#

I got O(n * log(max(arr)) solution for day 7

#

๐Ÿ™‚

sinful pawn
#

god. can't believe we're on day 7 already

#

I still have been procrastinating day 4

weak torrent
#

day 6 was the toughest till now imo

sinful pawn
#

oh boy.

winged trellis
#

but on average weekend puzzles are harder because you have more time to do them

weak torrent
#

hmm 4 and 5 were more like simulating was they told

#

6 was the first time we had to optimize

winged trellis
#

True, that is the norm on average tbh

willow ocean
#

Guys, do you think there is also an analytical solution to today's challenge?

weak torrent
winged trellis
#

my current solution is about 13 ms, but i loop over the short range

weak torrent
#

tbh I don't feel my solution will work for every possible test case

#

but in this format it just works

winged trellis
#

if we pooled all inputs together we could prove experimentally that the range most likely is at one index instead of +- 1

sinful pawn
#

I have a feeling there exists some massive inputs somewhere

winged trellis
#

if i remove my range where i do my educated guess, i go from 13ms to 5ms

willow ocean
winged trellis
sinful pawn
#

I'm gonna try using Arraymancer for day 4

sinful pawn
#

nvm I'm already confused

#

what on Earth is a tensor

modern scarab
#

a matrix with n dimensions

sinful pawn
#

I figured that out a bit later

queen python
#

Question on day 6 part 2. Is it possible to solve part 2 with 'brute force' algorithm? If yes on what machine? I guess a lot of ram? Part 1 works but part two is very slow and crashes with out of memory.

oblique pasture
#

Did The Site Go Down?

peak dock
#

yeah looks like it

oblique pasture
#

๐Ÿ˜ฆ

winter vigil
#

the key to day 6 part 2 is realizing the redudancy in the way the fish grow over time

peak dock
#

someone calculated it would take 11 terabytes of ram for the bruteforce to work

winter vigil
#

wow

winter vigil
#

yea, they really wanted you to think outside of the box for this

#

when i figured out the O(n) solution, i was soo happy

#

realized how simple it actually was

queen python
#

Yep problems are generally difficult until they are simple ๐Ÿ˜œ i agree. This one is still hard for me lol.

weak torrent
#

is the 25th problem in aoc similar to mediums in cp?

peak dock
#

you can check out the past years' problems

sonic silo
#

at least the first part

#

the second part... well

#

that depends on how well you did

weak torrent
#

oh

mossy basin
#

2019 day 25 i managed to solve the puzzle adventure thing really fast by pure luck

#

oh i even globaled

#

finished 44th on day 25

sinful pawn
#

lord I hate day 4

winter vigil
#

Day 4 is the bingo one?

#

I still need to do part 2 of that

sinful pawn
#

omg finally

rapid wolf
#

Gj

#

Not mine afaik

fossil cipher
#

I hate these kind of AoC puzzles. I managed Part 1 on my own, more out of dumb luck than anything. Part 2 I had to borrow ideas. Still no idea how it works.

wary veldt
#

I used brute force for day 7 and it took less than 2 seconds in python

fossil cipher
#

Yeah. Maths/Stats is not my strong point. I did consider just brute forcing it but I feel like that's my solution to everything in AoC when I barely understand what's going on ๐Ÿ˜„

wary veldt
#

hopefully it gets more interesting soon, I was kinda disappointed and surprised when my brute force solution not only worked but was so quick even with a 'slow' programming language

fossil cipher
#

Day 6 was fun.

Part2 - 256 days

Easy!

fans go to Orbital Launch Speed

hmm...

Very pleased with myself when I realised what the better way was ๐Ÿ˜„

bright spindle
#

I went straight for binary search, it didn't even occur to me to bruteforce it.

hollow wharf
#

is there any way I can post a PDF? I wrote a whole-ass paper explaining why the mean kinda works for part 2, and I think it's pretty nifty

bright spindle
#

I don't think so? I guess you can put it somewhere and link to it.

hollow wharf
#

this is so sad

fossil cipher
#

I hope the paper is titled Whole-Ass Paper on Why the Mean Kinda Works.

loud yew
#

my solution for part 2 took 1:24 to run .-.

fossil cipher
#

or Why the Mean Kinda Works - A Whole-Ass Paper

bright spindle
#

Do What I Mean, Not What I Say

hollow wharf
fossil cipher
#

Wait for the day that shows up as a citation in a statistics paper somewhere ๐Ÿ˜„

hollow wharf
#

that's the goal

fossil cipher
#

I'm not in academia, but I heard somewhere recently that any scientific/mathematical paper that has a question in its title, the TLDR is "No".

#

Is that true? ๐Ÿ˜„

hollow wharf
#

I'm trying to put this damn thing on my website and it refuses to work for some reason

humble escarp
#

Done ๐Ÿ˜„

sinful pawn
#

omg my answer matches the sample

#

now, one prays

#

fuck. lol

#

what'd I do this time

hidden musk
#

does this input look like intcode or...

#

should I actually read the problem instead of just looking at the input

sinful pawn
#

well... this ain't good

#

I keep getting an answer as 0

sonic silo
#

SAME

#

that happened a lot and im not even sure why

#

it delayed me for 20 minutes unnecesarily

sinful pawn
#

I've also come to realize that kitty is very annoying to work with

#

the scrollback buffer does not get cleared with the rest of the terminal

#

I thought I was scrolling through like an infinitely long error, but it was just a concatenation of all my past errors

loud yew
verbal rampart
#

.aoc join

sinful pawn
#

I wanted to get this down hours ago

#

I'm so confused

#

this should be impossible...

#

this is driving me insane... How on Earth is this even possible

#

the entire board gets filled up without triggering a win until the very last number

sinful pawn
#

... but I cannot replicate for the sample input meaning I have no idea of figuring out what edge case I didn't account for

#

it literally works perfectly for the sample

bright spindle
#

@sinful pawn Debug and step through the code line by line until it does something you didn't expect.

sinful pawn
#

I've been doing this for like the past hour ;-;

bright spindle
sleek cave
#

sees problem
wait, isn't this that familiar math problem I solved a few days ago
realizes I brute forced that problem
oh.

sinful pawn
#

welp... I've gotten an answer other than 0

#

here's to more praying

craggy wraith
#

i guess Rust is saving us from Docker in this challenge

sinful pawn
#

praise the lord

#

I feel a lot less proud of myself than I should

sleek cave
#

i feel like starting from day 6 the challenge isn't just programming the solution anymore, nothing is straightforward and you need to actually have a good algo to solve

#

woohoo, algorithms, the number one thing I'm not experienced with

sinful pawn
#

this too so long, man

#

5 hours!? Surely I procrastinated for most of that

sleek cave
#

lol, took me 3 minutes for day 6 part 1 and 3 hours straight for day 6 part 2

sinful pawn
#

I'm on day 4 ๐Ÿ˜”

#

well... actually... I can finally say that I was on day 4

sleek cave
#

day 5 now, WOOOOO

sinful pawn
#

๐Ÿ˜”

#

my brain is fried

sleek cave
sinful pawn
#

I don't even wanna look at day 5 or 6

#

I hear people saying that 6 is tough ๐Ÿ˜”

fossil cipher
#

Day 5 and 6 aren't too bad

sinful pawn
#

yeah and people said day 4 was easy peasy

sleek cave
sinful pawn
#

but here i am

fossil cipher
#

day 6 is mostly a case of "what the hell... how..." then easy peasy if you realise the best method ๐Ÿ˜„

sinful pawn
#

shame

#

I've got a headache

sleek cave
sinful pawn
#

please tell me that day 5 and 6 aren't anything to do with nested sequences

sinful pawn
#

oh no

fossil cipher
#

day 6 is just a list

sinful pawn
#

I... hate trying to comprehend "board" logic

#

and whatever the heck tensors are was a mistake

fossil cipher
#

only one "board" on Day 5 ๐Ÿ˜„

sinful pawn
#

oh no

sleek cave
#

||one xy coord system on day 5, that's it||

sonic silo
#

tbh

#

these days arent too bad, you should take it easy and try to subdivide the problem into simpler parts and youll eventually be capable of assembling a proper solution

craggy wraith
sinful pawn
#

My problem was that the sample input was too short for me to accurately test

#

I also actually accidentally did part 1 wrong

#

I forgot to consider columns

#

I only checked rows

woven sable
#

Day 7 isn't as bad as I expected it to be

bright spindle
#

Why did you expect it to be bad?

woven sable
#

Hmm, considering we're a week into AOC

#

Is it easier because it's a weekday?

bright spindle
#

I find that aside from a few outliers, most AoC problems don't really get significantly harder as you go.

#

There isn't much of a difficulty progression.

fossil cipher
#

I think it's more your own knowledge that dictates the difficulty. If you fail to spot the pattern or class of problem, you're doomed to struggle.

wooden jewel
#

Didn't they have you write interpreters and shit previous years? Day 7 - 2020 looks significantly harder than day 7 this year at least

sonic silo
sonic silo
#

in that you needed ||recursive memoization||

#

(iirc)

bright spindle
#

2019 was the intcode year, I think

#

But it wasn't as bad as all that

sonic silo
#

IMO 2019's problem was just the fact that an early puzzle was required in order to solve a latter puzzle

#

so if you couldnt for any given reason resolve day 2, you couldnt resolve the rest of like. 10 puzzles dedicated to intcode

fossil cipher
#

I quite liked the intcode puzzles, but yeah - if you failed to solve an intermediate step it kinda sucks

sonic silo
#

otherwise interpreted puzzles are neat

#

i actually really love aoc 2019 and how creative it got with a lot of its puzzles, its such a shame its so infamous lol

fossil cipher
#

I should revisit it. I recall one puzzle where you had to link up several instances of the program. I solved it by hacking together a bunch of generators. Be interesting to see if I learned anything since then.

Prediction: I probably haven't ๐Ÿ˜„

craggy wraith
#

my code probably wasn't the best for time complexity, but it still worked

#

it just took like 3-4 mins to run though

wooden jewel
#

(I didn't participate in 2019, but might try at a later time)

fossil cipher
craggy wraith
#

i want to try complete some of the previous years, which ones would you suggest to start with

sonic silo
#

any of em, hell you might as well pick and choose puzzles from different years

mossy basin
fossil cipher
#

Might be an excuse to really dig into async. I suspect it will be beneficial to me in at least one project at work I want to start at some point.

mossy basin
#

i recommend "Build your own async" by beazley

woven sable
#

Beazley has so many great talks

woven sable
fossil cipher
#

I'll have to check that out. Cheers

woven sable
#

oh

#

I should bm that

mossy basin
#

can just bookmark that

woven sable
sinful pawn
#

bad manners

hollow wharf
#

is there a way to make today's first part without bruteforce?

hidden musk
#

yes

hollow wharf
#

@peak dock haven't done the challenge first ๐Ÿ™ˆ

#

so there is

#

hmm

#

right

peak dock
#

oop

hollow wharf
#

alright, surely there is no none bruteforce solution for the second part, right?

#

or should I keep thinking

#

(something reasonable, no like crazy linear algebra with matrix exponentials and whatnot)

tight dune
hollow wharf
#

yes

#

I mean bruteforcing is the obvious solution but is there a better one

tight dune
#

i have been wondering the same thing

#

heck, is there a better algo for part 1 itself

#

i bruteforced part 1 too

woven sable
#

So basically a solution that isn't O(n^2)?

tight dune
#

i guess

hollow wharf
#

yes

#

part 1 can be O(n)

#

O(1) in finding the right end position

woven sable
#

Like out of curiosity

tight dune
#

WAIT

woven sable
#

Oh yeah

hollow wharf
#

||The most optimal solution is the median of all the input||

#

assuming linear cost

tight dune
#

then i gave up and brute forced it

rancid mural
#

I remembered a story my math teacher told me about Blaise Pascal solving part of this problem, but googling it just returned Pascal language implementations of something else

hollow wharf
#

0.33s, good enough

#

lru cache is such a beast

eternal berry
#

Does anybody know a time-efficient way of getting the day4 puzzle into some data structures?

mossy basin
#

is that bingo

eternal berry
#

it sure is

hollow wharf
#

ooh

#

O(log n) should be feasible

mossy basin
#

i used re utility combined with numpy

#

but, you can easily get boards without that

bright spindle
mossy basin
#

oops, this is not spoilers channel

tight dune
eternal berry
#

๐Ÿ˜„

mossy basin
#

my bad

final eagle
#

aight i am out all day

#

whats today's aoc

#

how hard is it*

peak dock
#

not too bad

eternal berry
#

can i ask, is getting the puzzle data into data structures meant to be coded also? i'm on day 4 and i've just manually put a bingo board into a list of lists and I don't think it's really feasible to go through each board and wrap them in brackets and add comma's etc. Should i look to code this? I had a look at numpy but that looks to expect data in a comma delimited list format.

hearty shuttle
#

Definitely code it up

#

As a suggestion, think of splitting the whole string into the boards piece by piece. Think either normal string split or regex to split

final eagle
hearty shuttle
#

If it helps, my approach is to always take the whole string as input, and then decide how to parse it

#

It depends day to day how the parsing goes

eternal berry
#

Hmm okay. I think this may be a bit advanced for me but i'm going to give it a shot ๐Ÿ˜„

mossy basin
#

when i first read the problem i thought it would be difficult, but i did get the answer in roughly 5 minutes for both parts

jade root
#

lmao i am 69th place

final eagle
#

i have given up on trying to get a good placing on the leaderboards

jade root
#

lol same

final eagle
#

cant really arrange my schedule to fit aoc in haha

#

now i am just doing it for fun

jade root
final eagle
#

interestingly still 122, wonder what will it be after the board updates

#

oh, rose to 44

hollow wharf
bright spindle
hollow wharf
#

good question

rapid wolf
#

the characters are randomized

hollow wharf
#

oh lol

hollow oyster
#

how can I even write code for aoc, I never went that far

hidden musk
#

how are you solving the problems?

hollow oyster
#

I never went that far

thick talon
#

how do u get all the elements that are in the same column in a list

peak dock
#

transpose it with list(zip(*A)) and index into it with the column #

steep shard
hollow oyster
steep shard
#

what do u mean "how to write code for aoc"

hollow oyster
#

don't question me I did not know how aoc works

#

now I know

steep shard
#

o

#

lol

native crystal
#

Is everyone busy trying to solve advent-of-code??

steep shard
#

is todays challenge like yesterdays

#

where u need to find a efficient method

rotund rapids
#

I mean this one feels kinda brute forcible, but an efficient method is nice

steep shard
#

kk ty

eternal berry
#

Hi all. I don't want to cheat and look at spoilers, but i'm struggling with parsing the data in day 4. I know exactly how I want it to look, and I think I know how to solve the puzzle once the data is parsed, I just don't know how to parse the data!

Would anybody be able to link me to some reading / a video that might point me along the right lines?

Thanks.

bleak sable
unique osprey
unique osprey
eternal berry
#

Il pop a spoiler tag on this just so I donโ€™t give anything away.

bleak sable
eternal berry
#

Sorry, just wrote out my entire plan on my phone and managed to lose it all haha. Just going to grab some food but will reply when I get back

bleak sable
#

Also, I don't think there are active spoilers of day 4 now in spoilers channel, so we can go there to comfortably debug your code :3

eternal berry
#

I'll bob over to the spoilers section and write my plan down

robust heart
#

I'm reading some of the problems and I was wondering what went through their heads with the scenario

real pine
#

Lots of lanternfish

heavy oxide
#

almost finished day two ๐Ÿ˜… how r u guys doing

eternal berry
#

Struggling on day 4 but it's definitely a good learning experience

heavy oxide
#

exactly

#

i am switching from c++

#

started learning python on monday

#

still struggling with basic errors

#

๐Ÿฅฒ๐Ÿ™ƒ

sleek cave
#

uh oh, why do i sense maze-solving puzzle in the following days

rapid wolf
#

prolog time

sonic silo
#

good thing college made me revise search path algorithms

sleek cave
rapid wolf
#

a programming language

#

one that has dfs builtin as a language feature

#

and makes it pretty easy to switch it to bfs

sleek cave
#

oooh nice

mossy stream
#

uh oh, maze solving is gonna be an interesting one

#

me who always wanted to implement A* pineapple

#

even if I know ali is gonna end up doing the challenge

woven solar
rapid wolf
#

this could be a cool clash of code, alternate in moving and placing a maze, whoever reaches the goal first wins

woven solar
hollow wharf
#

oh god why did I post a math thing of Reddit

#

now I have to put up with people telling me I'm dumb in the comments

low condor
#

Most people seem to like it, and you got 500 upvotes!

#

You'll always get people calling you dumb when you put something up. Tis a fact of the internet

hollow wharf
#

I am learning python and C++ simutenoalsy

#

Or however the fuck you pronunce it

hidden musk
#

why?

sleek cave
#

sigh i'm struggling at day 7 part 1, i don't want to brute force it but i may have to

low condor
#

all you have to do is work towards the answer - anyway you can

#

if it works it works

#

you can always look up if there was a more efficient way later

wooden jewel
#

Also brute force isn't too inefficient today

#

It isn't like the fishes one where you needed a million billion gigs of memory

sleek cave
#

you leave me with no choice, eric

#

the brute is here.

wooden jewel
sleek cave
# low condor if it works it works

lol, cheesed it with brute force, got them stars :p
gonna start working on a faster sol when i have time, i still have homework from school to do ๐Ÿ˜”

low condor
#

It ain't cheese if it works

sleek cave
#

agreed lol

torpid karma
#

Ye, I feel like most of the solutions should use brute force because it leads to more coding and less math XD.

winter vigil
#

advent of math

#

lol

sleek cave
#

why find an elegant solution when you can automate trial-and-error

#

@hollow wharf i was browsing r/aoc when i saw your paper, absolute masterpiece

#

sadly, i can't read it because i'm still attempting to create an elegant solution

sleek cave
#

lol others have the same prediction

pine tiger
rancid creek
#

different leaderboards with different number of players

minor cave
#

If you complete the earlier days much faster than the other person, and otherwise you're close, you'll be put ahead on boards with more players that complete the earlier days because it earns you more points

topaz summit
#

@warm monolith let's not post random inappropriate videos

winter vigil
#

please dont

warm monolith
#

I will post those videos in here.

winter vigil
#

is there a memes channel?

topaz summit
#

!ban 300234897241669642 troll

marsh currentBOT
#

:incoming_envelope: :ok_hand: applied ban to @warm monolith permanently.

topaz summit
winter vigil
#

#python-memes

sleek cave
#
 1)  489   463 |  54.33%  51.44%
 2)  448   437 |  49.78%  48.56%
 3)  414   358 |  46.00%  39.78%
 4)  314   296 |  34.89%  32.89%
 5)  281   274 |  31.22%  30.44%
 6)  278   263 |  30.89%  29.22%
 7)  254   246 |  28.22%  27.33%
```๐Ÿ“‰
hollow wharf
#

some interesting math discussion later I have discovered that there exists a closed-form analytic solution to Day 6

#

It's quite ugly, but it does exist

#

huh it would appear that my attempt at writing a paper about the math behind day 7 has very much angered someone. this is unfortunate.

minor cave
#

haters gonna hate

hollow wharf
#

Trying to share things on the internet sucks. I just wanted to do fun math, now someone is mad at me over some lack of rigour in my analysis

hollow wharf
# bright haven who is angry?

someone from another programming server. I'm just going to ask them to write and post their own paper if they care to dispute what I've done. I'm fine with someone coming up with a different result, but they've just been attaching a "this isn't right" comment to like half the comments in the thread

#

I don't even know if it is right at this point, but the notifications are exhausting

#

Like, it turns out that the validity of criticism has no bearing on how exhausting it is to take

bright haven
#

yes, true.

#

ignore that guy.

hollow wharf
#

yeah just a new thing for me. not very online so I'm not used to stuff like that

hidden musk
#

unfortunate that it's such an expected thing ๐Ÿ˜”

hollow wharf
#

it's just tiring. i just wanted to share some cool math

#

I was thinking about writing another short paper about how day 6 is closely connected to ||circulant matrices|| but I don't really feel like it after this

placid lake
sharp panther
#

Would you be willing to share that paper here? I'd love to take a read.

placid lake
sharp panther
hollow wharf
hollow wharf
hidden musk
#

plethora

placid lake
hollow wharf
placid lake
rancid creek
#

ok, starting day8 now, wish me luck on guessing the problem!

#

(mostly kidding)

sharp panther
#

I don't really understand some of the equations, but great paper CrashAndSideburns!

peak dock
mossy basin
#

1000 seconds to go!

humble copper
#

9 minutes

#

here we gooo

sinful agate
dim sphinx
#

how long did it take for y'all to process part 2 of day 6, its been 15+ minutes for me so far, just wondering?

hollow wharf
#

I have a lab report due at midnight worth 16% of my final mark Iโ€™m so stressed

humble copper
dim sphinx
#

run

humble copper
#

oh

#

there might be something wrong with your code

woven oriole
#

it will take 16 TB ram for the naive code to compile

humble copper
#

for me its (almost) instant

woven oriole
#

for part 2

hollow wharf
#

All days have a solution which will run in under 15 seconds

dim sphinx
woven oriole
#

most of the people fell into the part 2 trap of day 6 lemon_pensive

humble copper
#

mmmmmmm thats not a good practice to have in the long run

hollow wharf
humble copper
#

input might be so large+complex that it just wont run in a reasonable time

dim sphinx
#

i guess il do that then, thx

hollow wharf
#

I think people worked out that unoptimised day 6 takes on the order of hours to days

#

Not sure tho

peak dock
#

yea its the memory which is the bigger problem

sick fern
#

oh, that

mossy basin
#

i feel like memory and number of list operations

sick fern
#

yeah ig

#

anyone got better algorithm for day 7 part 2 tho?

#

I don't like bruteforcing

humble copper
#

but that seems to be a recurring pattern for me

mossy basin
hollow wharf
sick fern
#

hmmm I haven't learn about calculus yet

#

damn

hollow wharf
#

Ah might be hard to understand if you donโ€™t know calculus

bright spindle
sick fern
#

binary search?

mossy basin
#

gradient descent is how you learn that mean is optimal

north silo
#

Who is ready for day 8?

peak dock
#

aye aye captain

sick fern
#

ye

winter vigil
#

is day 8 gonna have recursion i wonder

bright spindle
hollow wharf
#

Binary search and gradient descent rely on the fact that ||the fuel function is parabolic, so the minimum is guaranteed to be global||

winter vigil
#

@hollow wharf yo whats up

hollow wharf
#

Well no not really

sick fern
#

yes ik what binary search is

narrow crown
#

ooh aoc in a minute

sick fern
#

I'm asking how is it used

narrow crown
#

โœจ still havent even seen day 5 โœจ

sick fern
#

in the algorithm

hollow wharf
humble copper
#

i believe in you

winter vigil
humble copper
#

๐Ÿ‘

woven oriole
#

SHEEESH

quaint hare
#

I woke up just for AOC

stable heron
#

nice

#

30 seconds

prisma sundial
#

another day another chall

stable heron
#

20

hollow wharf
mossy basin
#

countdown in my terminal is leading the browser countdown

winter vigil
woven oriole
#

gl guys

quaint hare
#

it still isn't released

hazy pendant
#

3s

hidden copperBOT
hazy pendant
#

nOow

sinful pawn
#

not again

quaint hare
#

what?

hollow wharf
# winter vigil 210

Didnโ€™t have any interest in talking more about that course lol. Hated it.

#

Just nothing I wanted to talk about there

winter vigil
#

lol i see

signal grotto
#

lot of reading today, gl all

quaint hare
#

my calendar shows it's 1 hour left

#

oh ok refreshed it

sinful agate
#

ugh

digital ember
#

holy that big wall of text

#

and you get nothing out of it

#

lol

hazy pendant
#

i don't understand

quaint hare
#

lots of reading

sinful agate
steel oyster
#

idk what to do

#

but it looks hard

sonic silo
#

hmm

hollow wharf
#

Oh god Iโ€™m not doing this tonight

narrow crown
#

it is kinda hard tbh

#

gonna do it in a few yrs

#

wish me luck

sinful agate
#

I will just go prepare for my exam smh

quaint hare
#

it's gonna be interesting

steel oyster
#

ill do it later, need to refresh

quaint hare
#

why are people just leaving

stable heron
#

so much reading

sinful agate
#

not leaving doing later

hazy pendant
#

i have IPython, why am i using regular Python lemon_angrysad

hollow wharf
#

I have a lab report I need to finish. Will attempt this once thatโ€™s submitted

sonic silo
#

this is like

#

the first puzzle that's actually hard to read

signal grotto
#

part 1 is really easy if you skip most of it and go read the very end

#

rank 598 on global ๐Ÿ˜Ž

tight dune
#

i didnt understand part 1

somber plover
#

how do you do part 1

quaint hare
#

how do you do any part

tight dune
#

nvm i got it

quaint hare
#

I should just read more

hazy pendant
#

so this is what i get for forgetting vimtutor ๐Ÿ˜ก

sick fern
#

ye easy

signal grotto
#

read less, the very first and very last parts are easiest

sonic silo
#

wtf

#

my answer worked

regal garnet
#

My brain stopped processing info after 2 lines, will be back tomorrow xd

sonic silo
#

dead, dead as hell

quaint hare
#

dumb paragraph you get anything from it at end

signal grotto
#

I think I'm leaving at part 1 for now, good luck y'all

#

only 31 people globally have part 2 so far

sinful agate
#

bruh I got 1 as answer smh

#

how so bad

pearl needle
#

part 2 is difficult damn

signal grotto
#

just a bit

sinful agate
#

I keep getting 1 :(

modern harness
#

My part 1 solution was effectively a part 2 solution... Managed to get on the global leader board for the first time this season

stable heron
#

LUCKY

fluid pebble
#

what is aoc asking

#

i dont understand

stable heron
#

i still dont get what to do lmfao

fluid pebble
#

yeah

#

@modern harness please tell us

sinful agate
#

I am so dumb....

pine tiger
#

honestly

#

crap problem today

#

just brute force

sinful agate
#

wth is part 2

quaint hare
#

part 1 worked for me

modern harness
quaint hare
#

I mean there wasn't any error, worked at first try. it's that easy Q today

sick fern
#

basically each segment is a letter

#

you don't know which

quaint hare
#

part 2 is the real question

sick fern
#

what you know is that some number is formed using these segments

#

you don't know which numbers either

quaint hare
sick fern
#

you have to find out which segment is which

sick fern
#

done

quaint hare
#

you have read

sick fern
#

I'm out for lunch before doing part 2 .-.

modern harness
# fluid pebble could you try your best

A clock digit has 8 segments, right? Suppose you I labeled them all a-g and told you which ones were lit up... except my labels are all jumbled up, maybe my top segment is d

sick fern
#

might have thought of smth

sinful agate
modern harness
digital ember
#

but 6 and 9 have same number of segmetns

modern harness
digital ember
#

uh and if you didn't

modern harness
digital ember
#

ah ok, i think i get it

#

thanks

quaint hare
#

part 2 isn't getting in my head

#

I'll read more

warm grail
modern harness
# fluid pebble ok

I've explained the problem... I'm not going to explain the approach for solving it in this chat room, you'll have to go to the spoilers chat for further hints

winter vigil
#

wait, do you need to use string permutations for part 1?

narrow crown
#

what in the world-

digital ember
#

rank 569 less go

#

thanks avongard :D

#

@woven sable looks like the test scraper failed today ๐Ÿ˜”

late frigate
#

Damn today was one interesting day

onyx plank
#

For the people who don't know what the problem is asking:
Seven segment displays work by having seven lights on a display to show a number. Google "Seven segment display" if you don't know what this is. The way it works in this puzzle are rather by having a letter represent one segment of each display. For example, I can have a represent the top line of the display. However, in this problem, each segment of the display is assigned a letter at random. You are given a list of lines where each line is a decode string followed by a data string, split with a pipe. Each line looks like this: decode | data. The decode portion contains the way to display every single digit 1-9. Because the letters are random, you don't know which letters will be used to display 1, 2, 3, etc. Additionally, the entire setup changes each line in the input, so you will need to decode each line separately. Once you decode a line, you use what you learned decoding to figure out what the actual numbers in the data portion represent.

#

Part 1
To display the number 1, a display will always illuminate 2 and only 2 sections, meaning that if your segment says dg, you know that's a 1, irrespective of which segments d or g go to on their own, as that's not important right now, you only need to know that that combination of letters in that line displays a 1. The number 4 also has a unique number of segments it illuminates, as does 7, as does 8. Find out how many segments are used in 1, 4, 7 or 8. Then, with that knowledge, find out how many times those numbers appear in the data portion of the input and that's your answer.

Part 2
Now you need to decode each line. Figure out which letter goes to which segment on the display. With that information, you'll be able to know exactly what combination of letters equals what number for that line. Using those decoded signals, figure out what the 4 digit number in the data section is. Sum up all the values in all the data lines and that's your answer.

stable heron
#

gosh this is tough asf

humble copper
#

ok this one is tricky

#

but im almost done

onyx plank
#

yeah as a newbie i'm just thinking on where to start and how i wanna do it, if I want to attach letters to segments, segments to letters, true falses for each letter, etc....

humble copper
#

ok im nearly there

#

will continue tomorrow

void ocean
#

meaning that each line is independent?

#

the wire/segment connections are different each line?

limber needle
#

yes

void ocean
#

ok thanks

sick fern
#

ye done

#

shouldn't have gone for lunch

onyx plank
#

I have a question: I'm currently trying to layout a method of doing this and I have a problem: If I have a list where one element is true, is it possible to find out which element is true and where it is in the list?

sick fern
#

yes just run through it

#

for loop

onyx plank
#

with an iterator gotcha

#

ty!

topaz summit
#

[e for e in mylist if e][0]

onyx plank
#

wow that's a very nice one line solution actually, ty

#

that's def going in the "save for later" file

void ocean
#

I'm guessing number 2 is number 1 but for hard digits as well?

trail flare
#

yea

void ocean
#

Alright, then investing time into doing the hard nums

hazy pendant
#

wait

#

aren't weekends supposed to be harder than others ๐Ÿ˜ณ

sick fern
#

why would they be

void ocean
#

because more people are available on weekends

onyx plank
#

idk man so far this is the hardest one by far

stable heron
#

idts..?

void ocean
#

oh hold up nevermind

woven oriole
#

smh

dark slate
#

really liked today's puzzle

void ocean
#

it says that a/b corresponds to c/f but theres a signal that's just cefabd

#

contains chars abcf

#

oh hold up i'm just confused lol

stable heron
#

lmao

#

one signal corresponds to one unique segment

void ocean
#

yep

onyx plank
#

abcdefg are standard for decoding a 7 segment, but the lines given to you are scrambled

devout tusk
#

Could someone explain part 2? How did they end up deducing 5353?!

spiral copper
#

your last underline is a different example

#

specifically the longer example they give above

pearl needle
#

the one-liner example and the larger example with several lines are different, yeah

onyx plank
#

this is a toughy

#

imma do this tmrw

clever pecan
#

today's was very manual, yet rewarding

#

ultimately a lot of fun

sinful pawn
winter vigil
#

man what even is part 2

#

does anyone have hints?

steel oyster
#

I (still) don't understand the problem

winter vigil
#

ik that you need to work off the arrangments of 1,4,7,8

#

to find the other digits

#

but the fact that its a unique signal pattern per line troubles me

dark slate
# winter vigil does anyone have hints?

think about the segments that comprise each number, how many of them there are and how you can determine that a pattern corresponds to a certain digit out of all the digits that share the same number of segments

void ocean
#

is part 2 finding the segment each signal pattern corresponds to?

#

instead of just the easy patterns which have unique lengths

#

because if it's not i'm spending time solving something i don't need to

clever pecan
winter vigil
#

spoilers

#

i mean, you could just add a spoiler to your msg

#

but idk if that slides

rancid mural
#

AAAAAAAAAAAA im dead

winter vigil
#

not sure how popular this opinion is: but today's part 2 is certainly harder than day 6 part 2

clever pecan
#

absolutely

void ocean
#

no one's arguing with you on that one

#

what's the output format for part 1?

#

comma-separated for each digit or

#

a sum?

clever pecan
#

just a number

dark slate
#

I'd say it was complex, but not hard
for day 6 I needed hints, now I figured it out on my own
it really felt like a puzzle

winter vigil
#

day 6 part 2 was soo easy when i understood how Counters worked

#

the collections lib is soo useful for aoc

#

i struggled hard last year, cuz i never made use of it

dark slate
#

I spent more time on day 6 than today

#

but I understand if some feel today was hard

winter vigil
#

half the battle is reading instructions

#

kekl

sleek lark
#

First time a learn a new feature if python. TIL sets

sick fern
#

kekw

#

damn literally lost and couldn't find aoc channel

sleek lark
clever pecan
#

defaultdict?

void ocean
#

I know how to deduct for part 2 but idk how to put it in code

#

grr

winter vigil
woven oriole
#

vscode hover text during part 2 be like

iron reef
#

dammit still not gaining ground

#

i need these to be harder so more people above me actually drop out of some days

wary veldt
#

I don't think I've solved part 2 optimally

#

the solution is too inelegant to feel like it's the best one

stable heron
wary veldt
#

I wrote a general solution that could work for any LED arrangement but that was most definitely not a good idea here

sinful pawn
#

y'all ever accidentally solve a part

wary veldt
#

not yet

sinful pawn
#

when your "solution" was fundamentally incorrect but somehow still ended up with the right answer

wary veldt
#

not yet

sleek lark
#

@iron reef Really ? Today I had time to wake up, commute, take coffee like any other day and I still gain 10 000 places.

#

Oh, I just found out that the year on the website always change format. Nice.

void ocean
#

I now know how to solve part 2 but it's less elegant than the solution I was working on

iron reef
#

there aren't even 10000 places on the discord's leaderboard

sleek lark
#

@iron reef I thought about the general leaderboard, sorry

iron reef
#

if we're talking about general leaderboard there's so many people you could go up a few thousand by starting one day at hour 23 then doing the next two at reset

winged trellis
#

can someone explain todays puzzle? i dont understand what to do or how my input works

final eagle
#

part 1 or 2

winged trellis
#

part1

sleek lark
#

Is there only like 120 poeple on the Discord's leaderboard ?

sinful pawn
#

oops, in #aoc-bot-commands

#

I just noticed something about the aoc lb command lol

#

Here's our current top 10 (and your personal stats compared to the top 10)!
Proceeds to only show you only the top 9 + you

proud cosmos
#

The string of letters are a direct representation of lit up segmets on the 7 segment as it says earlier in the day

final eagle
#

be cfbegad cbdgef fgaecd cgeb fdcge agebfd fecdb fabcd edb | fdgacbe cefdb cefbgd gcbe
left of | is signal patterns, right of | is the final output
the so called "signal patterns" is what segments the submarine tries to light up when displaying a number. every line in your input has a different pattern. for example, in this line, be will most likely light up the number 1 (since only 2 segments are lit) (refer to mspaint diagram), while edb will light up the number 7 (since only 3 segments are lit)

for part 1, you are required to find what digits are lit up in your final output, but since digits 1,4,7,8 has an unique number of segments lit up, they can be easily derived

winged trellis
#

oh right.. thanks that makes sense to me

pearl needle
#

you're gonna love part 2

peak dock
# winged trellis can someone explain todays puzzle? i dont understand what to do or how my input ...

there are seven segments {a, b, c, d, e, f, g}
if the segments {a, b, c, e, f} are on it diplays 0, if its {c, f} its 1, etc
there are also seven signals {a, b, c, d, e, f}, but they aren't connected to the segment with the same label, its shuffled randomly

the first part of each line (before the |) has 10 sets of signals, and each set of signals will map to a set of segments, and that set of segments maps to a digit between 0-9
the second part of each line (after the |) has 4 sets of signals, which follow the same mappings as the first part, and thus represent 4 digits. this is called the "output value"

the first part of the question asks how many times the digits 1, 4, 7 or 8 appear in the output value

proud cosmos
#

Pretty sure they(recreation) just explained part 2 (at the end anyway)

winged trellis
#

thanks its clear to me ๐Ÿ˜„

final eagle
#

i mean the logic is the same haha

#

i just visualized it

proud cosmos
#

When I first saw the problem I was like oh god what is part 2

#

then I noticed part 1 is just counting some random stuff

#

At least it still took me hours to do part 2 anyway

final eagle
#

i feel like copilot is a OP intellisense

#

sometimes i just need to repeat parts of my own code and it does that for me

#

sadly i cant generate perfect answers

hollow wharf
#

hmmmmmm today's is quite difficult

#

well, to me

#

I have a guess as to how to proceed

pearl needle
#

yeah part 2 is the hardest problem we've seen so far

craggy wraith
#

i just read the first part of the problem and i have no clue whats going on

peak dock
#

also takes like 15 minutes to read and understand the problem lol

minor hamlet
#

Havenโ€™t got to it yet

blazing kraken
#

The day 8 is hard tho

#

Tbh

pearl needle
#

you'll have to decipher every digit in part 2

blazing kraken
#

Lol

minor hamlet
#

So brute force?

pearl needle
#

maybe, I dunno

hollow wharf
#

I think there's something sort of pretty here, but I'm going to have a damn hard time writing it

long scarab
#

Day 8 Part 2 is murder!

sleek lark
#

@long scarab part 2 is not that bad. You have to reason in terms of segment and what each number can have in common.

gloomy kernel
#

Hello people

#

Part 2 is ๐Ÿ˜…

fringe temple
#

I've had my fill of Python's sets ๐Ÿ˜…

blazing kraken
#

I still dont undestand todays wuestions

#

Question*

iron reef
#

part 2 is just laborious, solve it on paper first

weak torrent
#

you gotta read it 5-6 times to understand this

#

only then you would get to know how crazy part 2 is

#

also why I am behind people who didn't solve day 8 part 2 on leaderboard?

devout tusk
weak torrent
#

I did

devout tusk
#

they solved rest of the parts faster than you did

#

which made their score better than you despite them not solving day 8 part 2

hazy pendant
#

BRUHHHHHH

#

I DID A MISTAKE BY ||Not Resetting acc2 after being added to acc||

#

I GOT 2 GOLD STARS

#

YAAAAAAAAY

bright spindle
loud yew
#

i just looked at the puzzle for today... im screwed

bright spindle
#

Given n people on the leaderboard, if you are the i:th person to solve a puzzle, you get n - (i - 1) points. It's entirely possible to score so many points on earlier days that some people can't catch up to you on later days even if they solve all puzzles.

sonic silo
#

that i never get cause like

#

theres this private leaderboard i am competing with a friend with and like

#

yesterday he suddenly got 8 more points over me, even though i was just second and he was first

#

for that specific puzzle

#

we were at the same amount of points before that

#

i shouldve just had a 2-point difference, not 8

pearl needle
#

i mean, you can make your own private leaderboard for just you and your friend

bright spindle
pearl needle
#

you can be a part of multiple leaderboards

sonic silo
#

oh well

bright spindle
sonic silo
#

no

bright spindle
#

Then how many points you get depend on when other people on the board solve puzzles as well.

sonic silo
#

hmmmm

bright spindle
#

If you are first, you get N points. If you are last, you get 1 point.

bright spindle
sonic silo
#

oh well

hazy pendant
bright spindle
hazy pendant
#

oh wait, there's no global scores

bright spindle
#

They aren't summed across leaderboards.

hazy pendant
#

๐Ÿ‘

#

btw i got the 2 stars

#

pog

void ocean
#

can we all collectively thank AoC for buffing up our GitHub activity

hazy pendant
#

lmao

#

i store my solutions the propreitary way

loud yew
#

i finished part 1, and now i am realizing just how screwed i am

bright spindle
hazy pendant
#

part1 is nothing compared to part2