#advent-of-code
1 messages ยท Page 44 of 1
10 seconds
10 secconds....
GLHF
10s
6
5
ngl, this emoji looks too much like a thumb
<@&518565788744024082> Good morning! Day 7 is ready to be attempted. View it online now at https://adventofcode.com/2021/day/7. Good luck!
hf
well i can still attempt day 5 right and its delayed due to school
good morning 
sure
seems like day 7 is a dfs min question?
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
I think I got a good solution but its gonna have to wait intil tomorrow
boom done
rip
damn it
i really have the idea but im not sure how to execute it
anyone else getting this on leaderboard pages?
i dont understand...
yay i made it to 3 days!
yep
i got two stars!
yo i did part 1
in 14 minutes :(
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
weekends:
damn aoc is down?
not for me?
the leaderboard pages
today's was easy
ikr
persoanl leaderboard is down
leaderboard
ah
i was looking at public leaderboard
welp time to uninstall python3.9
It was ez today..
yeah
kind og
i just brute forced
Hey... is the advent of code site crashed or unresponding?
Hmm that was actually alright
||the fuel, not the position||
imo many libraries don't supportit yet.
no
oof
i reject
i will install python3.10
ok..
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))```
i reinstalled pip, time to install bloat
||you're just going through the different inputs||
and yes i installed python3.10-full instead of python3.10
||the most efficient horizontal position is not necessarily in the input||
yes i just noticed that
i can't read instructions lol
||what if there are multiple crabs in one position?||
this was so much easier then yesterday
It was much computer-friendly than yesterday.
yeah it's an off-day
which is probably why the website went down 
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 :)
difficulty is not balanced at all
but ofc as I say this they seem to come back
literally easier than yesterdays, much easier than the day before that
it increases in linearly on average
there are some off days to control pacing and prevent burnout
also weekends are harder on purpose
ok day 7 done
just finished too
wait just for future reference
is having this happen an indication of something not being done optimally
no its 31.3
it could mean that?
51% total
oh yea read wrong
well python was taking up 90% of my memory yesterday from my list with like billions of elements
me when list(permutations(inp, len(inp)))
.aoc join
probably not lol
.aoc join
You never need to pass len() of the list you're passing to permutations because that's the default
hello, could someone give me a hint on whats wrong with my code for lanternfish part 2
i had memory error when using same method for first part
try optimising it
if you are ||appending to a list|| beware because ||it will end up needing terabytes of memory, aka not gonna happen|| so you likely need a new approach
yes
how do i put spoilers btw
ok, thx i have an idea of ||memoization|| hopefully that works
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
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
ohh ok
Easiest way around it that I found was to do:
for i in reversed(x):
what should i do then alternatively
We don't care about the order of the elements in this case, so reverse works well
don't mutate lists while iterating over them, you'll run into really funky things
oh why should i reverse the list
i forgot how i did this one
woudnt it output the same result?
instead: y = x.filter(lambda s: s[0] != "0")
Nope. If you delete from back to front, you never shift the elements indexes. Using reversed probably isn't the best way of doing it, but it works.
i dont rlly know this but im guessing filter filters out stuff based on a condition and lambda s is the condition?
yes
it passes each item into the function as s in this case
keep if true, toss if false
ohh i thought you just iterate through a reversed list
alright tyy
at least today was easy
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 ๐ฆ
you need a condition when u get to one element right?
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.
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 ๐ฉ
@sinful pawn
try list(filter(lambda s: ..., x))
huh?
nono try this
oh alright thanks
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
only the 2nd element is being remove tho
Why would only the second element be removed?
Ah sorry, my screenshot is misleading
yeah all should be removed, if it's second thing
so the next step in the loop is to remove all strings with a 0 at index 9, which is all strings
probably went wrong on some previous step
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)
not sure
If 0 and 1 are equally common, keep values with a 1 in the position being considered.
did u take that into consideration
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
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 ๐
I have 1000 elements in my puzzle data, so I did (len(puzzle_data)/2) to get my threshold so to speka
yeah, that would produce wrong result
so if 1 or 0 >= (len(puzzle_data)/2), then that is the most common bit in that index position
instead get a new, less wrong threshold after you filtered the numbers on each step
use the sample data first
and see if that works
Ohhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
...
Massive oversight on my part ๐
i wonder if its possible to extract the sample quickly from the webpage
did u figure it out?
I can see where i've gone massively wrong yeah ๐
there was a script that aimed to do that yeah
nicee where did u get wrong?
It's how i'm figuring out my threshold. I was doing it once for the entire puzzle, rather than making it part of my loop
what day do you guys think will the first recursion heavy problem?
ohh lmao
yeah that would be nice
friday
oops wrong server
hmm the personal stats page is still down
.aoc stats
:x: Please use #aoc-bot-commands for aoc commands instead.
oh yay, that's a thing
Day 3 complete. That was a tough one ๐
day 6 was the toughest till now imo
oh boy.
i found 4 and 5 to be harder then yesterdays
but on average weekend puzzles are harder because you have more time to do them
hmm 4 and 5 were more like simulating was they told
6 was the first time we had to optimize
True, that is the norm on average tbh
Guys, do you think there is also an analytical solution to today's challenge?
I found one, it decreased my time from 0.68 sec to 0.015 sec on python
for part 1 yes, part2 you have to guess within a very short range
my current solution is about 13 ms, but i loop over the short range
tbh I don't feel my solution will work for every possible test case
but in this format it just works
if we pooled all inputs together we could prove experimentally that the range most likely is at one index instead of +- 1
I have a feeling there exists some massive inputs somewhere
if i remove my range where i do my educated guess, i go from 13ms to 5ms
Nice. I have a solution in NumPy and it's basically instantaneous.
Nonetheless, I'm interested in the analytical solution. Could me point to some resource?
there has been a lot of talk about it earlier in #advent-of-code-spoilers-archive
I'm gonna try using Arraymancer for day 4
thanks
For those wondering: https://mratsim.github.io/Arraymancer/
nvm I'm already confused
what on Earth is a tensor
a matrix with n dimensions
I figured that out a bit later
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.
Did The Site Go Down?
yeah looks like it
๐ฆ
use the Counter() from the collections library
the key to day 6 part 2 is realizing the redudancy in the way the fish grow over time
someone calculated it would take 11 terabytes of ram for the bruteforce to work
wow
I see ๐
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
Yep problems are generally difficult until they are simple ๐ i agree. This one is still hard for me lol.
is the 25th problem in aoc similar to mediums in cp?
you can check out the past years' problems
the last day tends to be much easier than its previous days
at least the first part
the second part... well
that depends on how well you did
oh
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
lord I hate day 4
omg finally
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.
What kind of Aoc puzzles? day 7?
I used brute force for day 7 and it took less than 2 seconds in python
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 ๐
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
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 ๐
I went straight for binary search, it didn't even occur to me to bruteforce it.
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
I don't think so? I guess you can put it somewhere and link to it.
this is so sad
I hope the paper is titled Whole-Ass Paper on Why the Mean Kinda Works.
my solution for part 2 took 1:24 to run .-.
or Why the Mean Kinda Works - A Whole-Ass Paper
Do What I Mean, Not What I Say
It's called "On the Unreasonable Efficacy of the Mean in Minimizing the Fuel Expenditure of Crab Submarines"
Wait for the day that shows up as a citation in a statistics paper somewhere ๐
that's the goal
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? ๐
I cannot speak to that sorry
I'm trying to put this damn thing on my website and it refuses to work for some reason
it's in #advent-of-code-spoilers-archive in png form
Done ๐
It's on https://www.reddit.com/r/adventofcode/comments/rawxad/2021_day_7_part_2_i_wrote_a_paper_on_todays/
0 votes and 0 comments so far on Reddit
does this input look like intcode or...
should I actually read the problem instead of just looking at the input
SAME
that happened a lot and im not even sure why
it delayed me for 20 minutes unnecesarily
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
ssshhhhhhhh
.aoc join
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
... 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
@sinful pawn Debug and step through the code line by line until it does something you didn't expect.
I've been doing this for like the past hour ;-;
Post your code in #advent-of-code-spoilers-archive
sees problem
wait, isn't this that familiar math problem I solved a few days ago
realizes I brute forced that problem
oh.
i guess Rust is saving us from Docker in this challenge
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
lol, took me 3 minutes for day 6 part 1 and 3 hours straight for day 6 part 2
day 5 now, WOOOOO
๐๐๐๐
Day 5 and 6 aren't too bad
yeah and people said day 4 was easy peasy
same for day 6 lmao, I asked for two light hints because I coded for 2 hours without progress
but here i am
day 6 is mostly a case of "what the hell... how..." then easy peasy if you realise the best method ๐
day 6 is easy if you have experience with a certain programming concept
ofc, if you're like me and you don't... expect hours of fun
please tell me that day 5 and 6 aren't anything to do with nested sequences
5 kinda
oh no
day 6 is just a list
I... hate trying to comprehend "board" logic
and whatever the heck tensors are was a mistake
only one "board" on Day 5 ๐
oh no
||one xy coord system on day 5, that's it||
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
this.
i had 11 for loops in my code for that problem
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
Day 7 isn't as bad as I expected it to be
Why did you expect it to be bad?
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.
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.
Didn't they have you write interpreters and shit previous years? Day 7 - 2020 looks significantly harder than day 7 this year at least
IMO, while the difficulty trend does absolutely exist, i dont think that affects as much as ^
||day 7 is just day 6|| in some ways
in that you needed ||recursive memoization||
(iirc)
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
I quite liked the intcode puzzles, but yeah - if you failed to solve an intermediate step it kinda sucks
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
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 ๐
my code probably wasn't the best for time complexity, but it still worked
it just took like 3-4 mins to run though
(I didn't participate in 2019, but might try at a later time)
I think generally weekend puzzles are more difficult or at least require a bit more finesse.
i want to try complete some of the previous years, which ones would you suggest to start with
any of em, hell you might as well pick and choose puzzles from different years
i did the same, but i'm pretty sure i would just write it async now
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.
i recommend "Build your own async" by beazley
Beazley has so many great talks
.bm talk
I'll have to check that out. Cheers
can just bookmark that
.bm link
bad manners
is there a way to make today's first part without bruteforce?
yes
oop
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)
i bruteforced the 2nd solution if u mean the 7th day
i have been wondering the same thing
heck, is there a better algo for part 1 itself
i bruteforced part 1 too
So basically a solution that isn't O(n^2)?
i guess
Oh yeah
oh i was trying mode, weighted mode, etc
then i gave up and brute forced it
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
Does anybody know a time-efficient way of getting the day4 puzzle into some data structures?
is that bingo
it sure is
||I found the optimal position with binary search, so that's O(log(m)*n)||
oops, this is not spoilers channel

๐
my bad
not too bad
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.
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
yep did it in 8 minutes, seems to be the second easiest i have done
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
Hmm okay. I think this may be a bit advanced for me but i'm going to give it a shot ๐
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
lmao i am 69th place
i have given up on trying to get a good placing on the leaderboards
lol same
thats the most important thing :)
interestingly still 122, wonder what will it be after the board updates
oh, rose to 44
interesting, the design of https://adventofcode.com/ and https://adventofcode.com/2021 isn't the same
It's good practice, parsing data is very common in all kinds of contexts in programming in general.
๐
what does this mean
good question
the characters are randomized
oh lol
how can I even write code for aoc, I never went that far
how are you solving the problems?
I never went that far
how do u get all the elements that are in the same column in a list
transpose it with list(zip(*A)) and index into it with the column #
wat
what?
what do u mean "how to write code for aoc"
Is everyone busy trying to solve advent-of-code??
I mean this one feels kinda brute forcible, but an efficient method is nice
kk ty
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.
Nah. Because the length of input is fairly short and you don't have to iterate it multiple times. Brute force is short to write as well if you use comprehensions in builtins :3
Is that the vector one? nvm it's bingo
What are you doing right now to parse?
Il pop a spoiler tag on this just so I donโt give anything away.
||After you separate number chain and boards, one board takes 6 lines (5 lines of numbers and one empty line)
Taking 6 elements from iterable can be done like this:||
||res = [my_list[i:i+6] for i in range(len(my_list))]
You will still have to parse those 6 lines into how you want to store your board, of course||
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
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
I'll bob over to the spoilers section and write my plan down
I'm reading some of the problems and I was wondering what went through their heads with the scenario
Lots of lanternfish
almost finished day two ๐ how r u guys doing
Struggling on day 4 but it's definitely a good learning experience
exactly
i am switching from c++
started learning python on monday
still struggling with basic errors
๐ฅฒ๐
uh oh, why do i sense maze-solving puzzle in the following days
prolog time
oh yeah... c r u d
good thing college made me revise search path algorithms
what's prolog?
a programming language
one that has dfs builtin as a language feature
and makes it pretty easy to switch it to bfs
oooh nice
uh oh, maze solving is gonna be an interesting one
me who always wanted to implement A* 
even if I know ali is gonna end up doing the challenge
A* ๐ฅด
this could be a cool clash of code, alternate in moving and placing a maze, whoever reaches the goal first wins
I think there's literally a codingame bot programming task similar to that
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
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
why?
isn't that one of the rules in "rules of the internet" lol
sigh i'm struggling at day 7 part 1, i don't want to brute force it but i may have to
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
Also brute force isn't too inefficient today
It isn't like the fishes one where you needed a million billion gigs of memory
still O(n^2) ๐ i reckon there's definitely a O(n) sol
you leave me with no choice, eric
the brute is here.
there is indeed :P
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 ๐
It ain't cheese if it works
agreed lol
Ye, I feel like most of the solutions should use brute force because it leads to more coding and less math XD.
this gives me "coding is for automation" vibes
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
thank you!
lol others have the same prediction
yo what
different leaderboards with different number of players
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
@warm monolith let's not post random inappropriate videos
please dont
I will post those videos in here.
is there a memes channel?
!ban 300234897241669642 troll
:incoming_envelope: :ok_hand: applied ban to @warm monolith permanently.
there is not
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%
```๐
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.
haters gonna hate
who is angry?
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
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
yeah just a new thing for me. not very online so I'm not used to stuff like that
unfortunate that it's such an expected thing ๐
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
woah, you the one who wrote it? that was a nice little read; good job!
Would you be willing to share that paper here? I'd love to take a read.
i'm sorry to hear this though. fwiw, i enjoyed reading through the paper
or perhaps in #advent-of-code-spoilers-archive if it contains specific details
It's on the subreddit. tried posting it here, but PyDisc yells at you if you try to post a PDF
thanks, that means a lot
plethora
you can DM it to me, and i can post it here if you'd like
sure, will do
@hollow wharf' paper on day 7 part 2
I don't really understand some of the equations, but great paper CrashAndSideburns!
"mostly" ๐
1000 seconds to go!
lol
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?
I have a lab report due at midnight worth 16% of my final mark Iโm so stressed
About 100ms
refactor code
process as in understand? or just run
run
it will take 16 TB ram for the naive code to compile
for me its (almost) instant
for part 2
All days have a solution which will run in under 15 seconds
yeah, mine isnt optimized at all, but i know it works, cause i got part 1
most of the people fell into the part 2 trap of day 6 
mmmmmmm thats not a good practice to have in the long run
You will need to optimise it or it will probably take several hours to days
input might be so large+complex that it just wont run in a reasonable time
i guess il do that then, thx
I think people worked out that unoptimised day 6 takes on the order of hours to days
Not sure tho
wdym trap?
yea its the memory which is the bigger problem
oh, that
i feel like memory and number of list operations
lol pain
||too much list comprehension is what got mine to work||
but that seems to be a recurring pattern for me
take the derivative of the cost function and set it to zero and solve for x!
@sick fern check this out
Ah might be hard to understand if you donโt know calculus
Besides the mean method, you can also use binary search or gradient descent to find the optimal position.
binary search?
gradient descent is how you learn that mean is optimal
Who is ready for day 8?
aye aye captain
ye
is day 8 gonna have recursion i wonder
In computer science, binary search, also known as half-interval search, logarithmic search, or binary chop, is a search algorithm that finds the position of a target value within a sorted array. Binary search compares the target value to the middle element of the array. If they are not equal, the half in which the target cannot lie is eliminated...
Binary search and gradient descent rely on the fact that ||the fuel function is parabolic, so the minimum is guaranteed to be global||
@hollow wharf yo whats up
Well no not really
yes ik what binary search is
ooh aoc in a minute
I'm asking how is it used
โจ still havent even seen day 5 โจ
in the algorithm
This damn lab report that I need to finish aaaaaaaa
you'll get there
i believe in you
why did you leave cpsc server
๐
SHEEESH
I woke up just for AOC
another day another chall
20
Which โun?
countdown in my terminal is leading the browser countdown
210
gl guys
it still isn't released
3s
<@&518565788744024082> Good morning! Day 8 is ready to be attempted. View it online now at https://adventofcode.com/2021/day/8. Good luck!
nOow
not again
what?
Didnโt have any interest in talking more about that course lol. Hated it.
Just nothing I wanted to talk about there
lol i see
lot of reading today, gl all
ugh
i don't understand
lots of reading
lmao ikr
hmm
Oh god Iโm not doing this tonight
I will just go prepare for my exam smh
it's gonna be interesting
ill do it later, need to refresh
why are people just leaving
so much reading
not leaving doing later
i have IPython, why am i using regular Python 
I have a lab report I need to finish. Will attempt this once thatโs submitted
part 1 is really easy if you skip most of it and go read the very end
rank 598 on global ๐
i didnt understand part 1
how do you do part 1
how do you do any part
nvm i got it
I should just read more
so this is what i get for forgetting vimtutor ๐ก
ye easy
read less, the very first and very last parts are easiest
My brain stopped processing info after 2 lines, will be back tomorrow xd
dead, dead as hell
dumb paragraph you get anything from it at end
I think I'm leaving at part 1 for now, good luck y'all
only 31 people globally have part 2 so far
part 2 is difficult damn
just a bit
I keep getting 1 :(
My part 1 solution was effectively a part 2 solution... Managed to get on the global leader board for the first time this season
LUCKY
i still dont get what to do lmfao
I am so dumb....
wth is part 2
part 1 worked for me
Its a little hard to explain... I think the best explanation is probably when they walk through the individual examples of how to go about it
I mean there wasn't any error, worked at first try. it's that easy Q today
could you try your best
plz
part 2 is the real question
what you know is that some number is formed using these segments
you don't know which numbers either
did you do part 1
you have to find out which segment is which
you have read
I'm out for lunch before doing part 2 .-.
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
might have thought of smth
I followed Ben's advice
If I said agb then you KNOW that is the 7 just by the fact that 7 is the only one that has 3 segments
but 6 and 9 have same number of segmetns
Right, but if you already identified 7, then 9 will have ALL of the 7 digits, but 6 won't.
uh and if you didn't
You use other logic like that. You use what you have identified
ok
and...
then do
from bank import psymoney
part 2 isn't getting in my head
I'll read more
did you understand what a seven segment display is?
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
wait, do you need to use string permutations for part 1?
answering in #advent-of-code-spoilers-archive
@warm grail
what in the world-
rank 569 less go
thanks avongard :D
@woven sable looks like the test scraper failed today ๐
Damn today was one interesting day
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.
gosh this is tough asf
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....
entire setup changes each line?
meaning that each line is independent?
the wire/segment connections are different each line?
yes
ok thanks
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?
[e for e in mylist if e][0]
wow that's a very nice one line solution actually, ty
that's def going in the "save for later" file
I'm guessing number 2 is number 1 but for hard digits as well?
yea
Alright, then investing time into doing the hard nums
why would they be
because more people are available on weekends
idk man so far this is the hardest one by far
idts..?
oh hold up nevermind
really liked today's puzzle
but the example input is contradictory
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
yep
abcdefg are standard for decoding a 7 segment, but the lines given to you are scrambled
Could someone explain part 2? How did they end up deducing 5353?!
your last underline is a different example
specifically the longer example they give above
the one-liner example and the larger example with several lines are different, yeah
this reminds me of last years
I (still) don't understand the problem
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
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
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
do we give hints in this channel or in the #advent-of-code-spoilers-archive
AAAAAAAAAAAA im dead
not sure how popular this opinion is: but today's part 2 is certainly harder than day 6 part 2
absolutely
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?
just a number
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
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
First time a learn a new feature if python. TIL sets
Maybe I am a bit too manual but I still haven't find a legitimate use for collection.
defaultdict?
defaultdict and Counter is useful
vscode hover text during part 2 be like
dammit still not gaining ground
i need these to be harder so more people above me actually drop out of some days
I don't think I've solved part 2 optimally
the solution is too inelegant to feel like it's the best one
lmao
same
I wrote a general solution that could work for any LED arrangement but that was most definitely not a good idea here
y'all ever accidentally solve a part
not yet
when your "solution" was fundamentally incorrect but somehow still ended up with the right answer
not yet
@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.
I now know how to solve part 2 but it's less elegant than the solution I was working on
there aren't even 10000 places on the discord's leaderboard
@iron reef I thought about the general leaderboard, sorry
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
can someone explain todays puzzle? i dont understand what to do or how my input works
part 1 or 2
part1
Is there only like 120 poeple on the Discord's leaderboard ?
see .aoc lb in #bot-commands
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
In the output values, how many times do digits 1, 4, 7, or 8 appear?
Because the digits 1, 4, 7, and 8 each use a unique number of segments, you should be able to tell which combinations of signals correspond to those digits.
The string of letters are a direct representation of lit up segmets on the 7 segment as it says earlier in the day
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
oh right.. thanks that makes sense to me
you're gonna love part 2
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
thanks its clear to me ๐
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
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
hmmmmmm today's is quite difficult
well, to me
I have a guess as to how to proceed
yeah part 2 is the hardest problem we've seen so far
i just read the first part of the problem and i have no clue whats going on
also takes like 15 minutes to read and understand the problem lol
Whatโs part 2?
Havenโt got to it yet
you'll have to decipher every digit in part 2
Lol
So brute force?
maybe, I dunno
I think there's something sort of pretty here, but I'm going to have a damn hard time writing it
Day 8 Part 2 is murder!
@long scarab part 2 is not that bad. You have to reason in terms of segment and what each number can have in common.
I've had my fill of Python's sets ๐
part 2 is just laborious, solve it on paper first
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?
cz you perhaps didn't solve day 8 part 2.......? ๐ค
I did
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
BRUHHHHHH
I DID A MISTAKE BY ||Not Resetting acc2 after being added to acc||
I GOT 2 GOLD STARS
YAAAAAAAAY
That means they were very fast to solve earlier puzzles compared to you.
i just looked at the puzzle for today... im screwed
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.
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
i mean, you can make your own private leaderboard for just you and your friend
Let's say there are 100 people on a leaderboard. I solve one puzzle first on day 1, so I get 100 points. You solve part 1 and part 2 for both day 1..8 last, so you get 1 point per puzzle. You now have 16 points. I'm still way ahead of you.
you can be a part of multiple leaderboards
oh well
Are you two alone on that leaderboard?
no
Then how many points you get depend on when other people on the board solve puzzles as well.
hmmmm
If you are first, you get N points. If you are last, you get 1 point.

What probably happened is, he solved the puzzles yesterday, then some other people solved the puzzles for yesterday, then you did, so you dropped behind depending on the number of people solving puzzles inbetween you.
oh well
btw, can people farm points by joining almost every leaderboard ever?
No, each score is specific to that leaderboard.
oh wait, there's no global scores
They aren't summed across leaderboards.
can we all collectively thank AoC for buffing up our GitHub activity
i finished part 1, and now i am realizing just how screwed i am
Yeah, part 1 is pretty easy compared to part 2 today.
part1 is nothing compared to part2
