#advent-of-code
1 messages · Page 14 of 1
which i absolutely struggled with
i gave up last year bc i slept really early one day and got behind on aoc during the hardest puzzles bc it was like day 16
On day3 part 1 what does adjacent even mean here, in the example they said 14 isn't adjacent, but it is diagonally adjacent to * . 58 is adjacent to +.
This is turning to be a english comprehension competition at this point.
*lanternfish, not jellyfish, but yeah that one was fun
that one and the snail fish
i hated the snail fish wtv so much
didn't they multiply or smth it threw me off
i think they mean that it isn't directly adjacent (up, down, left & right), but it can be diagonally adjacent and still count too
but 58 is directly adjacent to + right (example)
on line 6
oh no
There's a screenshot somewhere of me at 100% RAM usage because of those stupid snailfish
it's not touching tho
it'd be adjacent if it was +58
instead it's +.58..
3rd worst puzzle for me that year
idk if i'll finish aoc this year bc i j don't have the time
2nd worst was the cuboids stuff and the worst was the scanner beacon thing it took me like 6 hours to find thensolurio
Oh i get it, so any symbol just below a number is considered touching it?
yeah as long as it's a cell away
yeah, beacon scanner was a nightmare disguised as a day-19 task
cuboids? which one was that?
like
..467...
.....+..
``` is touching
Okay thanks for the explanation. The statement should've been more verbose
2021 day 23
my fav problems in 2021 were the flooding ones
ah, right, reactor reboot. yeah, I also cheesed it with numpy and then got dumped into 3d-interval-intersection-hell in part2.
i loved getting to use BFS & DFS and all
i honestly forgot what they were
but i'll relearn them eventually
i never forgot bfs and dfs ever since my professor casually mentioned that the only difference between them is using a queue vs a stack to store nodes to be processed. this is how I thought of them ever since.
I learnt bfs 5 weeks into learning python
and dfs last year day 19
don't think I've ever used iterative dfs tho
oh my god
i remember this
it was torture
yeah, 2022 day 19 was pretty evil too. you needed a good heuristic or the search was way too slow.
honestly i prefer 2021 day 19 over 2022
im prob gonna give up on day 15 again tbh
ive tried 2022's 3 separate times and still haven't gotten it to work
I spent a good while on day 19 before it finally clicked and I understood what I was doing
one of the days for 2021, cant remember which one it was
it had like a trajectory prediction thing
in all honesty i just bruteforced it on a large enough area
and it got the right answer in a really reasonable amount of time
oh day 17
wow i’m looking at my past solutions for these oh gosh
hah i implemented lshift and rshift for day 17
that’s pretty funny
finding the cycle for day 17 was really something
constraint solver!
my notes for day17 (rocks falling) say "don't know why this works, but it does"
hopefully it's going to be less of a pain than ocaml
idk why i do this to myself but ive made it a challenge every year to try to complete these without any imports
not even stdlib imports
it absolutely is
the one year i completed a full calendar was my first one doing it
instant burnout on day 25 🤩
todays puzzle long
I don't know if this event is something for me. I've been studying python for data science on datacamp for a couple of months to prepare for a bootcamp I will take. Tried the first couple of days but I never learned anything remotely close to this and at this point I wonder if I'm wasting my time.
What is DIGIT_MAP?
Finished day 2 🥹🥹
I agree day 2 was fun lolol on day 1 there's a tricky test case :v
eightwo?
another day another part 2 easier than 1
i belive thats just cause the parsing is already done
I wanted to automate receiving the puzzle input with a get request
But forgot we needed to login in order to get it at all
breaths in
breaths out
holy *&@#/ part 2 today is really not cooperating with my part 1 solution
xD
That's how they work.
Part_1 usually introduces the problem, let's you write the correct parsing and makes sure, you understand.
Part_2 is where the meat of the problem really is.
Does anybody have any methods toc hcek if a number is adjacent to a symbol?
your answer is not right
for first part, man how do i debug whats wong now lol
example case produces the correct result
well now you have a problem
that i do
ive made a map of all the correct parts, so its probably something im going to have to find manually
Does anyone have advice on debugging? like spotting silly mistakes, slight logic errors, edge cases, etc?
The biggest one is to run against test input
Usually, but not always, you can shake out any issues by doing that
I write automated unit tests for my code. So with one click I can run all tests and show my code isn’t broken by a change I made
alright part 2 done, super easy
Unfortunately the test input didn't contain any zeroes
functional fever i suppose
Yeah that’s unlucky
But the next thing is then to grab a section of your real input and test against that
Yeah I grabbed the first line which had no symbols, and it returned 1500
So I was like hang on
Also, you can avoid bugs by writing more resilient code
it might be because I'm doing this with an added challenge, but today seems much harder than I would expect from day 3
I know it’s kind of like saying “if you are lost in the woods, just try not going into the woods to start with”
my solution has 193 LoC for todays, way more 'difficult' than previous days
But you can check for digits using str.isdigit() or using regex with \d
And these are more robust ways of detecting if you have a digit
I would agree with this yes
I didn't want to deal with it being untyped + I checked for "123456789." and I didn't want an and
I still suspect the ante has been upped because of AI
But an and is more resilient
How
Well because you don’t need to code in all the digits directly
Another option is string.ascii_digits
Oh lol - one sec
!d string.digits
string.digits```
The string `'0123456789'`.
You could have used this and add . on the end
In general you want to reduce the amount you have to hardcode
The more you hardcode the more potential sources of errors can creep in
Ok good to know
i couldn't do this earlier because it was sunday
Does anybody know any methods to check for adjancet numbers? i cant figure one decent.
||regex||
i have used it for the past 3 days
i used ||^/$ with slicing||
i actually just used ||regex|| for the ||.findall() feature||
im on first day:
how is the last line interpreted as 77?
1abc2
pqr3stu8vwx
a1b2c3d4e5f
treb7uchet
there's only one 7. or is it because of this hint:
||```
...single two-digit number.
if there is only one number then it is repeated
ok
you take first number you find going from left and going from right
forming a 2 digit number
so in this case both from left and from right side the first number is 7
hence number will be 77
On each line, the calibration value can be found by combining the first digit and the last digit (in that order) to form a single two-digit number.
first time i read it, didn't make sense lmaoo
Advent of Reading Comprehension :)
my day1part1 didn't just compile in two minutes
my laptop is crying
I’m curious to see what your code looks like
nvm i was compiling the release build
Oh what language are you using?
trying it on rust 😄
tbf im on a 7yo lapto xD
where can I see the full leaderboard? I just saw Petr Viktorin in the aoc leaderboard and I am curious to see which other core developers are taking part here
is day 2 easy guys?
today's AOC is cruel
any number adjacent to a symbol, even diagonally
yes, but day 3 ramps up difficult again
im scared of day 4
i think for day 3 i'll just convert input into a 2d array
so i can index stuff easier
I just went ||yolo and used regex||
today seems kind of hard
[Day 2] ||Regex|| has always confused me a bit. If I'd like to find how many red, blue and green ones there are in a draw, for example:
3 blue, 4 red1 red, 2 green, 6 blue2 green
||How would I go about parsing all these with the same regex, and still know which part of the parsed data is blue, red and green? And how do you handle the different orders of items, as well as some items not being present in all draws?||
I'm not looking for a full solution, but rather how I should approach thinking about this problem in terms of ||regex||
||I wouldn't use regex||
but also, you can use ||OR statements, like (blue|green|red)||
Yeah, I know how to ||match some things||, like the thing you sent, but I don't get how you'd extract useful information from it, like how many blue, red and green ones exist
you can't solve the problem with one tool alone
guys ... day 03 ... went to grab bunch of correct numbers, but the sum not ok ... missing something here?
grab all numbers with adjacent to symbols ... i checked like 8 lines from the txt
||you need to check the other lines as well. ALL adjacent values to the number||
Of course you need more than one tool to solve the whole problem, but that doesn't make the tool useless for extracting some information
i dont think today was difficult
just time consuming
i mean, maybe it was difficult if youre like.. golfing it lol
I think today is difficult if you don’t have a good approach, and I think more people than usual for a day 3 puzzle will not have that
But if you have a good approach then it’s fine
today is difficult for me because i overthink things
Can the same number have more than one adjacent symbol?
Theoretically yes but it doesn't seem to ever actually occur
ok thats greatr
||With a regex, you can have multiple capturing groups. Each paren is a group, so you could capture: "(digits)space(blue|green|red)". The match object would have the digits in group(1) and colors in group(2). So, one regex, multiple matches, and each match has both digits and color||
Ah, that’s neat!
honestly that's a more efficient way than what i did
i just did this:
||```py
if color == 'red' and quantity > fewest_red:
fewest_red = quantity
elif color == 'green' and quantity > fewest_green:
fewest_green = quantity
elif color == 'blue' and quantity > fewest_blue:
fewest_blue = quantity
I used 3 different regexs patterns for each colour
Just sorted Day 2, without looking for hints and only a couple of googles!
Or this
day 3 looks tricky
overthinking in general is bad
by overthink i mean like
if i think there is a neat/clever way to do something that isn't obvious at first, i'll tunnel vision into that method for ages
fair
it's still bad tho i agree
maybe I'll try solving some of the puzzles with gleam 👀
Does anyone know if the inputs and by extension solutions vary per the person? Just submitted Day 3 part 2 and was winding dowin watching a video og some of the "pros" and their solution number was different than mine?
Yes, there are multiple inputs
(sometimes, when you get a wrong answer, the submission page will tell you it's the right answer for someone else :P)
Oh that's devilish. Thanks!!
Yeah that sounds about right
this year is definitely starting off harder than any AOC I can remember. part 1s weren't impossible, but part 2 definitely ramp hard
I wouldn't even say it's p1 vs p2
for day 3 i think the difficulty is part of the whole day, not just p2
I felt part 1 was at least intuitively solvable ||if you know about sets|| at least
but that led me down the absolute wrong path for part 2
right - day 1 part 2 is the hardest day 1 puzzle
how so?
i found part 1 of today significantly harder than part 2, but i think that was mostly my solution for part 1 being well suited for part 2
part 2 took me 5 minutes, part 1 took me 2 hours 👀
||because I didn't preserve the position of the cogs so I could check neighboring numbers||
oh i see
so now I need to write another parsing function instead
I think that'll be an easier approach
very intuitive naming
consider having todo!() in parse2, instead of doing -> !. the former won't be an error.
you can't use todo in the return position
yeah, i mean just don't specify the return type. or, I guess, ! would work too.
on nightly it's not an error I think
huh
I don't think the never type is stable
seriously?
plenty of stuff the compiler devs get to use that stable doesn't 😂
*Never as ! is unstable
Never as std::something::Infallible is perfectly stable
I forget where in std Infallible is but it is stable
in python it's just called typing.NoReturn
but I don't think it has the same characteristics as never where anything can be cast into it
in python you dont even have to typehint
we do have a Never, too. they're equivalent
!d typing.Never
typing.Never```
The [bottom type](https://en.wikipedia.org/wiki/Bottom_type), a type that has no members.
This can be used to define a function that should never be called, or a function that never returns...
!d typing.NoReturn
typing.NoReturn```
Special type indicating that a function never returns.
For example:
```py
from typing import NoReturn
def stop() -> NoReturn:
raise RuntimeError('no way')
``` `NoReturn` can also be used as a [bottom type](https://en.wikipedia.org/wiki/Bottom_type), a type that has no values. Starting in Python 3.11, the [`Never`](https://docs.python.org/3/library/typing.html#typing.Never) type should be used for this concept instead. Type checkers should treat the two equivalently...
Dang problem today is not so easy anymore
This 2D problem is on a different level from the previous ones
probably to combat LLMs, took me three times the time to solve this one than the previous ones
that's an interesting thought
the language has been a lot harder to understand in the prompts to me as well
much nicer than NoReturn imo
I didn't find it too complex to understand, but I haven't done the previous years (this is my first), so I don't really have a point of reference
day1part2 was more what I was referring to with my statement
the sample set they provided did not have the edge-cases you needed to solve for
yeah, that I don't like
i think the main struggle with d1p2 was not having clarification for the edge case
but if they had it in the sample set, you would've found it very early because your tests would fail
Yeah it feels that the problems are worded in a very roundabout way
not informing you of every edge case is an intentional part of the difficulty. I have no problem with it
With lots of flavor text (read: gibberish for LLMs) as well
but it was poorly worded and the edge case wasn't possible to catch
ehhh, having to manually invent test cases isn't something I find interesting.
I thankfully didn't run into that problem (i sort of guessed that it was the case), but that did happen for me on today's (my solution didn't account for when ||the number is on the edge of the board||, which wasn't in the sample)
but it is
the very first number is
unless you mean ||the right edge|| but that should be intuitive
yeah, I forgot to ||reset the flags whenever the line reached its end, thankfully I realized quickly||
For me I was having a bit of troubles with indexing
the problem isn't that there is an edge case, it's that it wasn't clear how it was meant to be handled
what edge case are we talking about?
in day 1 part 2, ||the overlapping word digits||
spoiler that please
||believe things like twone and nineight||
||eightwo|| real one
I'm not convinced that needed to be explicitly explained. I think it would have to be explained if ||overlapping|| made it so they weren't valid
I didn't have troubles with overlapping ones though, since I found the digits independently from each other
18 wasn't one of the edgecases
it was clear ||they only wanted you to replace one through nine||
when i was writing my solution, i didn't even realize that was happening in the input, my code just handled it without me knowing
||oneight||
||They didn't test for that actually, I had zero in mine and I saw some other solutions that counted above nine and it still worked||
you would get wrong answers if you replaced more parts
Well no problem stated quite clearly that we were looking for digits, not numbers
actualy wait
no you wouldn't, but it wasn't part of the question
digits are numbers
On each line, the calibration value can be found by combining the first digit and the last digit (in that order) to form a single two-digit number.
Bruh digits =/= numbers
yes they are
fs
i had some really weird regex solution
i should've just iterated thru the string and put the string into buckets of 5, and see if it contained a digit and then convert it to its number form in the string
ughh... another day where sample input parses correctly but the actual set doesn't
which day?
3
Happy to chat more in #aoc-solution-hints but in genral I would say ||check boundary conditions - can you parse numbers and symbols at the edge of your input, etc.||
hmm, it might be missing ||if a gear is at the end of the bound since that's kind of tricky||
see:
||```rs
for m in number_finder.find_iter(input.inner[y - 1]) {
let x_start = m.start();
let x_end = m.end();
// check the start bound edge case
let slice_start = if x_start == 0 {
0
} else {
x_start - 1
};
// check the end bound edge case
let slice_end = if x_end == input.x_max {
x_end
} else {
x_end + 1
};
if (slice_start..slice_end).contains(&x) {
neighbors.push(m.as_str().parse().unwrap());
}
}
write a sample input with that case and see if it works
it kind of does, but only for tuples
you can use dataclass with dataclasses.as_tuple
yea ik there's unpacking
doing a decent pace for part 2 minus the first day when I had work lol
is the star of the left a part of the tree graphic or am I missing something on day2 and 3?
trebuchet
Its you being loaded and then flung into the sky
that was my issue, i had a ||gear at the very last line which prevented my code from working till i fixed it||
how to get "Advent of Code" role?
and should i get it?
i think i see
hmm
im confused
what does &aoc link denballakh do? i dont see any changes neither in discord nor in AoC website
this was a thing in python2
I have to study for a test tomorrow and i randomly decided to do AOC day 1 in regex... WTF is wrong with me
Average internet user
my issue was I had a variable at the wrong nesting of loops
so I was pushing all the neighbors for a row into a given list
tbh I used regex for day 1 too
Is it ok to ask a clarification question regarding day 3 part 2?
yup, you're welcome to ask here. If you need to get into more of the particulars you can ask in #aoc-solution-hints
i've used regex every day so far lol
I wanted to clarify:
A gear can only have EXACTLY 2 adjacents? Anything with more than 2 can't be a gear?
correct
Awesome. learned my lesson in day 1 about understanding the instructions and wanted to clarify
thank you!
i take it all back
im suffering again
even after reading up on solutions
i can't implement in python
Which day is this?
Ahhhh
Honestly there’s no shame in that
In 3 years of AOC it’s the toughest problem for me personally
im currently following
- this js solution
- this haskell solution - i have never seen haskell before but the language looks incredibly elegant
but when i try to implement it in python...
- the intersection cuboids i store multiply exponentially, completely unfeasible
- i get wrong answer for larger sample input 😩
ig if i may have some hints
i'd greatly appreciate :D
in spoilers ofc
There is one solution that sort of worked for me
I actually don’t know where to write AOC 2021 spoilers lol
Anyone know hmac?
just here lol
with ||
oh
ping me :) i'm taking a short break and will be back to tackle this soon
Anyone know hmac?
This is a server for Advent of Code. You probably want to ask your question in a help channel. More info is here: #❓|how-to-get-help
im pretty sure i took inspiration from your solution for that problem bc i was lost
or acc no that was the snailfish one
cuz i genuinely couldn't figure it out
was reactor reboot the cube one
I had to look up a solution because I was completely and utterly lost
yes it was
"my" solution is now in #aoc-solution-hints if you want to look
yeah i lowkey took inspiration from someone's solution for that one too
i was lost
lemme look
snailfish on the other hand I am proud of my solution for that
ur code looks so clean wtf
hah
well i still don't understand it
I'm trying to read whatever the hell I wrote
right now
me too i found my solution and idk wtf is going on
like idk what's going on ||https://github.com/Shom770/adventofcode-2021/blob/main/solutions/day_22.py||
you solved it though so that's very good :)
aoc is awesome
there is a guy on aoc reddit who solved it in 21 lines of code, it's pretty crazy
Wow
does anyone know for day 3 part 2 if a possible edge case is: ||more than 2 adjacent, and if so, for example if I had 3 adjacent, should those all then be multiplied?||
I haven't checked manually, but I would recommend accounting for it and the task is exactly 2 numbers near a star make a valid gear
do you want me to spoil whether there are more than 2 or not?
||what if line 2-4 has a number in line 4 for a gear, that is then also correct for like 4-6 for example?||
sure
although we have diff puzzle inputs, so maybe mine will if yours doesnt
||no, all stars have only 1 or 2 numbers attached if my script is running well||
wait the inputs are unique?
O.o I had no idea 😄 that's really nice
is your first line .....180.........230..........................218.....189......415.......................322....507..................206..............111...?
nope my first line is ...............307............130..................969...601...186.........................................312....628..........878..........
wow, okay so you should probably account for the edge case then 😄
roger
do you know about this one at all?
I don't understand, can you provide a small example?
sure
||- in line 3 I have an * that's adjacent to a num ber in line 2: 455 and a number in line 4: 333.
- in line 5 I have an * that's adjacent to a num ber in line 4: 333 and a number in line 6: 111.
will I end up having to use line 4:333 twice? or is it excluded if it is already used? ||
||the language of the part2 assignment makes you focus on the stars rather than the numbers, we are interested in gears which are represented as the stars, then we have the sentence "Its gear ratio is the result of multiplying those two numbers together." so I wouldn't expect you need to account for that and in your case you would use the same number twice for the two different gears||
alrighty, thanks a lot 🙂 then I can not over engineer this one
actually wait...
ruh-oh
let me check I said the right thing
legend
I've just read my entire input and I don't have that edge case 😅 so I have no idea which is correct, but in my code ||I only consider each number once||
sorry
based on how the assignment reads I think my previous suggestion was correct, I would expect my solution to fail for your edge case
@cinder tree sorry for spamming, once you solve it could you send me your input so I can check if my solution is correct by comparing against your answer?
Hi! I'm working on solving AoC in a single line of Python code. Does anyone have any tips? I made it through a dozen days last year and have Days 1-3 for this year! https://github.com/savbell/advent-of-code-one-liners
Mostly I'm wondering if anyone has any little-known tricks for shortening longer code/statements into a single-line expression! A few of the things I'm already doing are under the "Fun Stuff" in the Readme.
hardest day so far for you guys?
that's crazy, good luck
to me, day 1 is the hardest. though i didn't do that in python
I had to think about day3 the most so that's my choice
Honestly same. I needed to chat with a friend to figure out what edge case(s) I was missing for part 2, while the other days I figured out on my own
the example didn't provide enough for the test. so i was left confused for hours
Thanks! 🥰 I just hope to make it further than last year. I stopped once I found myself trying to implement A* in a single line...
I'm not a programmer so seeing people do magic with regex is way beyond my comprehension and what you've already done is incredible to me
#1180008645384216606 will probably have some tips for you!
Is anyone able to use the /aoc join command mentioned in the aoc-faq channel?
I see the error on our side. It's unclear why it's happening though. Did you get the board you were assigned to?
No, I got the message that the application did not respond, only that.
Oh nvm, I was being dumb, I used it in the wrong channel
advent of code should edit their inputs so it suits the sample input, because i'm not gonna inspect thousand of lines to see where the fuck is the erro
what the hell did i do
the result for day1 part2 changes when run a bunch of times
It shouldn't do this
im laughing so hard idfk what i did lmaoooo
you achieved true randomness
maybe it's because i used hashmaps for one thing
yep
the iterator gives back values in arbitrary order
gotta think of something else
I personally like visual debugging for that reason.
what is that
When you execute the code and see what it did at the a visual level. So you can see what is going on. I'm using G'MIC to do AoC, so when I execute my code, I get displays of images reflecting the output of my code.
my code gives the right answer for every single input, idk how and why aoc full input is not accepted
Day 2?
1 part2
Oh that. The simple example doesn't cover corner cases
which are
twone -> two one
depending on hashmap ordering 🥴
may the odds be ever in your favor
damn I used to know the response for that it's been too long since I read/watched hunger games lol
there's a response?
I could have sworn there was
i just like the phrase :p
Language Roulette: Day 4
The language is ... Lisp
dope language
any one in particular?
(oh (no))
why
())()()((((())
any flavor?
stinky
pick your fave flavor
i knew i was gonna see parenthesis the second the language was chosen
Lmao
what are the languages in the roulette?
they're all pinned (the ones so far, anyway)
:) a secret
hanging out in VC0 if anyone wants to chill and talk about the AOC
oo
*(knows (fisk) (see (brackets)))
i love lisp, but i can't type parens very easily
someone need's to greenspun's tenth rule this one and implement their own lisp
it's close enough
its 8am rn, i cant speak, my neighbour is sleeping
lisp but [], () and <> all mean the same thing
{} feeling left out, ouch
<@&518565788744024082> Good morning! Day 4 is ready to be attempted. View it online now at https://adventofcode.com/2023/day/4. Good luck!
oh nice, parsing work isn't bad
33/18 let's go
I feel like I probably shouldn't say that at least until the p2 leaderboard is full
we're so back
yeah ok
Oh you got 9/6 nice job
ty
Jesus 9/6
where's oliver ni
insane
done at 00:07:08, much better than yesterday's 00:11:37
did he leave the server?

||Instead of getting points you get bonus cards (copies of the next N cards where N is the number of matches), figure out how many you have in total||
def crazy():
print("""Crazy?
I was crazy once.
They put me in a room with a function.
A recursive function.
A recursive function with no base case.
That made me crazy.\n""")
crazy()
crazy()
💀
Lmao
ah ic
43s for p1 is NUTS btw
that might be gpt
but i'm probably coping
Wait I'm 89th global now let's go
64/396 p2 choke again
Rip
nah today p1 looks doable in that time at least imo
I'm not good at writing quick code tho so idk
I didn't read and thought p2 was looking for ||the total score and not the number of cards||
I should really get used to using F5 to run my code lol it probably cost me several places
the time difference though lmao
/aoc join iirc
your guess is as good as mine
elves are pretty useless
honestly you could get this one just by reading the example
feels like fate that lisp was chosen for today
Also if your input library prints your input when it first fetches it (at puzzle unlock) you can start thinking about parsing while the puzzle loads
(e.g. for today, it's pretty clear that ||two splits + extracting ints|| is a good parse)
they've managed to fuck something up every year for 8 years straight, I would say they're more of a problem
is there any way to get this linked to my github account? i made this current account with my gmail but i want it to be able to display my gh username and link to my gh page
If you have an AoC account with your github linked and any progress, contact eric
toggle it in the settings
If not, make one, then IIRC there's a setting
Oh wait yeah you might be able to just link another oauth provider
yeah if your github account has no progress you can just migrate it across
I did that a few days ago myself
(in settings)
ah the example made me do a double take
Card 1: 41 48 83 86 17 | 83 86 6 31 17 9 48 53
In the above example, card 1 has five winning numbers (41, 48, 83, 86, and 17) […]
"wait what 41 isn't in the numbers"
[…] and eight numbers you have (83, 86, 6, 31, 17, 9, 48, and 53). Of the numbers you have, four of them (48, 83, 17, and 86) are winning numbers
(rereading it after risking it anyways and finishing) "oh"
yeah i had an int extractor and a multicharacter split thing prepared
awesome tyyyy
(if the github-linked account has no progress you don't have to contact him)
I saw the example input and "Card 2 has two winning numbers" and I could tell what was going on
i only used the int extractor though bc i know there are 10 numbers on the left
Oh yeah I guess you could partition it like that
it almost works but for some reason i cant get the username to link to the profile
ik theres a setting for it but it resets every time i click out
oh
nvm
theres a save button
💀
LMAO
there we go
Is there inherent disadvantage when it comes to timezones?
I mean being in the UK and having it at 5AM isn't great from a sleep POV
yeah probably
doing this at 8am is pretty hard
(because i didnt sleep)
Guess I'll accept never having a score
midnight feels like a sweet spot
yeah
Yeah I totally agree with that
I prefer at 9. That's ideal. It's 12:30 AM and I am in my bed.
Imagine coding a solution in Python from your phone
I mean QPython is a thing
fumbled soo hard on part two lol
💀 so much space wasted already
ugh, i'm so close with part 2. Works with the example but not my input. I have a headache though, not sure i can look at my screen much longer...
yeah, reading it at first was a little confusing, but once you understand it's pretty simple
yeah
i still odn't understand it to an extent lmao
i finished but i kinda don't get it
like it hurts my head to think about it
Oh boy when I finally get home I will get creative
turns out at my pace i would need ~8h per each AoC (whole year) if i wanted to solve previous years
it took me 6h for one problem once in AOC in 2021 lmao
it really gets hard around day 15-20
I couldn't participate in 22 cause I went to work trip or smth
Now I am gonna complete it all 
In a cursed way
i will try to complete all AoC's until new year
My 25th solution probably gonna be written in hieroglyphs
i'm too lazy to go back and do the years i didn't finish
this is my first time doing aoc, so far the questions have been fairly straitforward. How hard does it get?
notoriously hard problems
i would say u can get through it tho
they get a lot worse
where do u find this
i swear ill finish 2022
lmao
unpopular opinion: snailfish was fun
i'm sure you will!
I agree
twins
19 and 22 were from the pits of hell
snailfish was fun for me
lowkey
what were those i kinda forgor
it was hard though
I didn't have much trouble with snailfish tbh
beacons/scanners and reactor cubes
i went to sleep at 4 am and woke up at 3 pm the next day and solved it bc i thought of the solutoin in my sleep 😭
i'm very inconsistent it turns out 😩
oh god i remember beacons and scanners
day22part1 doesnt sound very hard, just do the thing they described
man i don't even remember what i did for those
oh god day 22 is cuboids
what was 23
naive solution needs unrealistic memory
I see... this is quite tedious to code
I trolled
I could not comprehend the problem for some reason
not even pt 1 its like you'd think the most obvious solution would work
but it just doesnt
that's still on my todo-list as well, found it very difficult
what’s this
100x100x100 = 1 million of items, no?
day 19 is scary
smh
day 19 is the robots?
yup
There's not a particularly clever solution or anything you just have to prune the search space when you know it's no longer possible
oh yeah part 1 was fine, part 2 is where it blows up
those r my least fav problems
where the naive solution doesn't work
but i also learn the most so
can you pls post part2 description here?
the # timesteps just goes up from 24 to 32
It's really the same solution though, a complete search
oh we're talking about different problems
at this point it is easier to just count it by hand 💀
i did 2021 day 23 by hand lmao
was that the armapods
oh they're called amphipjods
i didn't get that one either lmao
armpits
||for part b i had a 30 second run time using recusion, then i memoized it and went down to instant runtime, am proud||
autocorrect 💀💀
classic recursion
i guess i will not be able to achieve this 😢
what in the recursion is part 2 😦
recursion, bout 12 lines
i made that up
DP problem
Day 4 is a bit early for a ||dp problem|| innit
well, todays easy!
is it just me or was day 4 easier than day 3?
still easy than day 1
fs
True dat, weekend shenanigans I guess
wait until next year when december 1 is a sunday
RE: Day 22: Monkey Map [2022]
oh is that what it is, are sundays tough?
puzzles on the weekend tend to be slightly harder
i see, its my first year this year so i have no prior experience, but i guess that does work great
wait really?
Man I hate it when my code runs on the small testcase but not the big bad input
Ah yes the feeling of the coming 3 hours consisting at looking at your screen to see if the numbers are correct
Yes yes, the period of pure despair
Which lasts until we find where things went wrong
And then you fix it and it doesnt work
Back to the period of pure despair, rinse and repeat until you got the approval message
i don't have one 👍
you can write imperative lisp if you want to, it is supported in common lisp
also which lisp? pick whatever?
flip a coin
Someone has probably already mentioned this but everyone who hasnt done any days in the python discord AoC leaderboard is tied at 69
how many sides does your coin have?
https://en.wikipedia.org/wiki/List_of_Lisp-family_programming_languages
The programming language Lisp is the second-oldest high-level programming language with direct descendants and closely related dialects still in widespread use today. The language Fortran is older by one year. Lisp, like Fortran, has changed a lot since its early days, and many dialects have existed over its history. Today, the most widely known...
flip a coin 6 times
the boring answer is to use common lisp
(is python a lisp?)
(it sure can process lists)
(for (sure))
I'll do day 4 in rust
difficulty really be completely random
kinda weird tbh
I got lucky the past 2 days but now I've never used any lisp
maybe only 2 are needed
Today, the most widely known general-purpose Lisp dialects are Common Lisp and Scheme.
guys, if i want to talk about the implementation of a solution that im struggling with, do I ask in the python threads or in here?
why are there only 10 people in the leaderboard
If you're talking about a particular private leaderboard on the aoc website, it's because pydis uses lots of them due to the limit of 200 users per private leaderboard
I'd say a thread to be safe
If you're talking about the command, it's because they removed the full leaderboard paste
That's for people doing the language roulette
Possibly there's only 10 of them :P
😭
how do i join the regular leaderboard
/aoc join
here?
i mean does it count as ||dp when you just add to the number of that ticket you got?||
it's ||dp||??
(yes)
i didn't know that
(also yes)
is it? i just looped it somehow
thanks
didn't know there is a special name for that
idk dp and i did it
Assuming you ||kept a list of how many copies of each ticket you had and only looped through the input once||, yes that counts as dp
i guess i used it then
||combined in the same list. just kept track of the number for each line||
I'd say ||dp|| is just a very fancy word for a ||recursive relation but you save the result for reuse later||
Technically I didn't say ||kept a separate list||, now did I :P
it's very hard to resist clicking
It's... well, spoilers, spoiling the idea of today's AoC
So if you don't mind that just click (?
sorry. should i delete?
Few mortals can resist the temptation of the clickable black bars
||pop||||pop||||pop||||pop||||pop||||pop||
||pop||||pop||||pop||||pop||||pop||||pop||
||pop||||pop||||pop||||pop||||pop||||pop||
||pop||||pop||||pop||||pop||||pop||||pop||
||pop||||pop||||pop||||pop||||pop||||pop||
||pop||||pop||||pop||||pop||||pop||||pop||
nice
Dude my friend sent me that exact same message but bigger just a few days ago
:incoming_envelope: :ok_hand: applied timeout to @earnest forge until <t:1701695412:f> (10 minutes) (reason: emoji spam - sent 100 emojis).
The <@&831776746206265384> have been alerted for review.
oopsies
bannable imo
100 is a lot, good lord
damn
Maybe he sent this but bigger & emoji
So 100 is the limit
!unmute @208918673178492929 just keep it ontopic please
Could not convert "user" into UnambiguousMember or UnambiguousUser.
@208918673178492929 is not a User mention, a User ID or a Username in the format name#discriminator.
no, it's more like 10
!unmute 232948417087668235
:incoming_envelope: :ok_hand: pardoned infraction timeout for @earnest forge.
Got it
we may or may not have a minesweeper pinned in ot1
Yeah (just checked) but it isn't fixed-width lmao
Guys, slightly off topic. How do I share a PyCon event in this discord? PyCon Pakistan is happening after a for few years.
a few years?
Sorry it after a few years
Reach out to @plucky beacon if you are one of the event organizers, otherwise, suggest it in #community-meta
Got it, thank you
snow day :D
what a beautiful time to grind aoc from morning til dark
goal today is to get aoc '21 dirac dice and day 25 of '22 cus i missed that freebie lol
and maybe beacon scan
lucky 😩
does greedy match with a negative lookahead not work?
wym? why not? what's your pattern?
i found todays easier cuz less regex
Question for day 3 p1 as I'm just getting around to it: ||do we count multiple occurrences of the same part number on the board indivually?||
yeah i think so(?)
Clojure/conj is so packed with must-see content that, unless you clone yourself, you can’t possibly attend all the great talks. To solve this problem and save your precious time, we have thoroughly analyzed the entire canon of Clojure talks and distilled them down into a single inspiring, thought-provoking, decomplected masterpiece that will blo...
Correct. Thanks, found my bug(s)
Gotta say this is easily the hardest first 4 days I remember for AoC
1 and 3 were definitely anomalous imo
2 and 4 seemed standard
following the pattern, tmr is going to be very difficult
day4 part1 was a nice break after yesterday 😄
Top3 at work are separated by 1 point each. 1st one is the only female among the 10 of us. This year is a blast.
&aoc lb
You are not allowed to use that command here. Please use the #aoc-bot-commands, #sir-lancebot-playground, #bot-commands channel(s) instead.
@shut trellis nerd
@long egret nerd
What
I'd agree about 2, but even 4 part 2) has a bit of a twist.
For comparison, last year's part 4 was literally just taking pairs of integer ranges, and seeing if a) one is a union of the other, then b) if they have non-zero intersection at all
very mechanical. For 4 part 2 you do need to be a bit careful propagating data forward and the most naive solutions will fail (and some already have)
I was mostly thinking of the overall trend though. It seems significant/consistent enough that it feels deliberate. I wonder if the goal is to make AoC harder as a whole, or just to make the start more challenging.
my naive solution ran incredibly slow
I just used ||a mapping to buckets and filled the future buckets using a nested for loop||
yeah
if I was smart, I'd ||cache the winning results so I wasn't re-calculating every time I needed to propagate, I bet @lru_cache would've solved that nicely||
though I'm not sure how that works with copying, maybe it doesn't work nicely
What is the report command again?
eh, can't find anything in the info channels, so I'll do a tag thing.
<@&831776746206265384> someone trying to solicit private sales off-server
user: 893177187723788318
message: 1181310928034214050
aoc '21 day 21: dirac dice
this is the most cursed thing i've written in some time
my logic was so straightforward 😂
just combinatorics everything with DP
leading to 8 levels of indentation
solutions referenced: salt's and david bartram's, except i wanted to solve it another way lol
@plain sluice don't post ads like this in this server
Ty for the report - for future reference though, you can DM @plucky beacon for getting our attention for stuff like this too
i'm willing to bet it's a gpt countermeasure
so my guess is that the first 10 or so days will be more difficult than usual, and after that it will be around the same level as the previous years
That is a really good point that I didn't think of despite noticing the problems seemed harder this year. They potentially even pre-screened these questions against chatGPT. Based on their announcement banning chatGPT, it seemed they might be mainly focused on preventing 100% automated solutions, which I wouldn't be surprised if the difficulty increase on the early problems does just that, though I haven't tried putting any of these into chatgpt, but I thought I recalled the fully automated solutions last year stopping at some point when they got a bit more challenging.
idk, I'd want additional evidence to believe that
there's fluctuations in the difficulty from year to year
but it's definitely possible
it would be very cool if the author goes on record about this at some point
I'm also not really sure (literally) to what degree human difficulty and AI difficulty match up.
we need john henry pt 2 for aoc problems
I've started benchmarking stuff
I'm debating whether I should benchmark solving both 1 and 2 together, or each individually
I know that if I do teh former I'm going to rewrite code in some pretty awkward ways to share stuff
day 4 is a pretty good example. counting matches for each line is significant, so you would want to share that between 1 and 2.
but dumping the number of matches into a vec is a needless heap allocation so you'd want to avoid that
so you'd need to have like, an "object" solver for part 1 and part 2, that has an update method, that recieves the number of matches for each line
bruh what the hail is this scartch card rule system XD
Really fighting the urge to do d3p1 by hand.......
I am trying to find the perfect regex
Technically doing it by hand
Considering the pain
Why do I do this to myself?
If you're stuck or need a hint, ask in #aoc-solution-hints , happy to help with regexs.
Often times, when I am feeling down, someone makes me feel elated to be part of such a vibrant community of nerds and geeks. Thank you so much. I will ask in #aoc-solution-hints. It's easy to isolate yourself.
is there a 2d regex?
I don't think so, haven't heard of such a thing
But you are thinking about 2D so you are on the right path
I was mostly just curious if there was such a thing
I did day 3 with quite different machinery while wrestling with haskell 🥴
😩
エニラ joked about creating 2D regex lol
(...at least I think that it was only a joke?)
Tbh I don't see how that could possibly work
a(?:↑b+)c
Lol
idk, it would probably end up very esoteric, but I could imagine it being a thing
But now is C above the b+ or to the right of it?
I imagined something like
.b.
.b.
abc
The only way I can really see that working is if you actually write it as a 2D string, but that would be painful to write in an actually fair way (you'd need some kind of defined padding character)
(?:) for scoping directions 🥴
looks like https://esolangs.org/wiki/Category:Two-dimensional_languages is a thing
or maybe it just being a direction change makes more sense 
or maybe as a 1D string, but using line length modulo (offset?)
abcba↑ba←a*↓c+
..aaa
..c.b
abcba
..c..
How about:
abcd((?vefgh)|(?^ijkl))
l
k
j
i
abcd
abcd
e
f
g
h
((?<), (?>), (?^), and (?v) are all disallowed sequences in 1D regex AFAIK)
What would be your (ASCII-only) choice?
why do we need to restrict ourselves to ascii?
Because we're doing good and proper language design here
?< ?> feels quite similar to lookaround 
oh crap yeah ?<= is lookaround
Maybe ?{direction}
Heck it could even extend to 3D regex with * and X 🙃
ok and?
?{NW}
Ehh ascii art arrows are better
you want ?{^<} ?
Is this implying that the regex depends on your system compass
i guess we're looking down on the world then
aren't we always?
rustaceans are descendants of the ocamlers
"point your device northwest for the code to run as expected"
'works on my machine' to a whole new level
it annoys me that on mobile 🧭 shows it pointing NW, looking at details shows it pointing NE
That sounds like an apple thing
Oh just discord being very dumb
I know that they have to use apple emoji on ios for some reason, didn't realise it's just broken in that menu on android
I'm pretty sure that's new since the change to RN
Day4Part2 was so hard for me 😦 Had to read through a couple solutions to understand how to write the recursion but I finally solved it
(and frankly the RN change sucked)
((if they're going to change the android codebase they should use flutter))
I didn't even do a recursive solution
Me neither
it was iterative in nature (but written recursively because lisp)
hm... maybe I overcomplicated it then
oh? i didn't recurse at all
yeah. clojure has these cool "reducer" things which are sorta similar to concurrent.futures.Executor.map
super easy to parallelize things by just adding another argument to the function call
oh right, you have a nice lisp
I saw someone ||make a list and then keep adding copies of the new cards to it while iterating over that list which eventually went over all the copies which I thought was neat||
that's pretty funny
? is this a function or something?
in python it's functools.reduce
you don't need to iterate over all copies anyway
i guess you could end up with a solution that touches all the copies somehow. but that would have a fun time complexity
oh, people wrote such things in here
oh I completely forgot about this function, I suppose it's not recursion but achieves the same
I can't help but feel like it's O(n^n) *(worst case) lmao
took like 16 seconds, fixing it made it 250x faster
my part2 solution runtime is 7.47s 🙂
it's bounded by 2^n for sure
probably significantly less with our constraints
your branching factor is at most the number of winning numbers isn't it?
That's fair, m^n
I tried that, but I kept ending up in infinite loops
I ended up changing it slightly: https://github.com/shenanigansd/scratchpad/blob/main/events/advent_of_code/2023/04/python/aoc_2023_04.py
why do you have a Deck class 😩. they're not playing cards
holy classes 😄 nice
It's not infinite it's just about 9 million
It was the first name that came to mind
a collection of cards is a deck so it checks out
if we assume that we add to every following card it's 2^n, and we don't allow even close to that
1 1 1 1 1 1
2 2 2 2 2
4 4 4 4
8 8 8 ...
Oh yeah fair enough
@classmethod
def from_cards(cls, cards: list[Card]):
return cls(cards)
``` what's this for? you don't use it anywhere
Only 1M for me
But yeah, in retrospect, my list solution may have worked if I had just let it play out
I just assumed it was broken because I saw it printing out giant lists
I might try rebuilding it and seeing what happens
Mb I meant 5.9 million
Misremembered the number
I'm surprised yours is as low as 1M though
huh. i got 1.1e7
Huh
You’re right
I guess it can just be removed then
Anyway time to go get 4h30 of core sleep before waking up for AoC tomorrow 🙃 o/ see you all later
what's cls for anyway? I've seen it in some repos before
or like what does it stand for
I had 8805731, took a while to get done 😄
class
It operates on the class itself, instead of a specific instance
