#advent-of-code
1 messages · Page 19 of 1
i didn't get the joke until you made me give it a second thought lol
difficult day 😦 I still don't know how to approach this
even hearing this doesn't really tell me what to do 😄 need to learn sth new to solve this
sure, this is outside of problems I normally encounter so I'll gladly take some help
This is a problem where you should not be expected to "discover" the algorithm on your own.
So yeah researching how to do it is 10000% valid
the general gist here is uh
Aoc is now a math challenge lol
||building the solution based on states on step at a time||
||now you can probably think of this as memoized recursion, and it probably is||
I don't even know how to account for the already existing # vs ? in my program yet 😄 I hope I learn something new and solve this by the end of today 🙂 thanks
alright glgl
is the brute force not gonna work for p2?
I doubt it
k
you can try
I have a ||dp solution|| formulated in my head, just don't have time to code it yet
brute force would be quick and easy tho so I'm asking in advance
||there's upwards of 2^50 cases per line, so definitely not||
just get a better computer smh
oh ||do the cases get that large?||
||they looked relatively small from a glance at my input||
ig ||the dp isn't too bad here||
we're talking p2 so
RIP I wrote a ||dp|| sol then realized the '#' must be together and not just nCr
p2 is ||repeating each line 5 times joined by ?||
Not quite sure how I am going to solve this
oh god I think I have a cursed solution involving ||popping from a list while iterating over it||
today was just hard 😧
I actually think it's pretty approachable idk
you don't have to do anything super clever it's just a matter of working thru all the cases
like it's not one that you just
if you don't know you don't know
it'll take a while but i think you can get to the solution on your own
||for p1 just bruteforcing seems very doable||
||that's because it is||
||for part 2 though you will have to cache your answers and re-use them||
I agree 100%, discovering ||dynamic programming|| independently doesn't sound like anything unmanageable
php will probably be my bigger enemy today...
if you draw out decision trees enough you'll eventually come to realize ||"hey, wait a minute, some of these subtrees are identical and we can save time by caching them"||
So try to draw it out. I will try that
can someone help me with today? i made recursive solution, it solves p1 under a sec but it fails to do part 2 for some reason, idk why
i have been trying for some time now
as unhelpful as this is going to sound (and I'm sorry about that), the approach for p1 is too slow
i made it recursive
it solves p2 under a sec
if you're doing what I think you're doing, then you're on the right track, and as a matter of fact the solution you have now probably looks almost exactly like the intended solution
but wrong
oh nevermind, then you just set it up wrong
well since someone already posted the link here, i'm going to assume I can do the same
i'm aware, i read your messages
it seems you were lucky
that, or you're setting up your ||dynamic programming|| incorrectly
i'm inclined to think you're probably doing the second
since the chances of the first happening are super low
there can be tons of reasons why this would produce incorrect answers quickly, can't know exactly what at this point though
its exactly same like p1
but different inputs
right, so you're dealing with edge cases
probably
if you're positive that you adjoined the input correctly
it is 100%
then that can only mean it was wrong from the start
in which case this is what happened
can u help me with my code, or give me a hint
i have no ideas on what i missed
sure
do i send it here or dms?
dms
(#aoc-solution-hints exists for aoc-related code help btw)
quit yo
I gotta say. I am completely stumped on today's AOC. any hints?
if you're on part 1, ||bruteforce|| is actually feasible, do you have any ideas on how that can be done?
yeah I can see that I probably could do that from the input data, but that feels like it's going to royally **** me over in part 2
well a faster algorithm would also explore all the cases, actually, but due to the ||recursive|| nature some ||memoisation|| could be used
hmmm
well. I may have to rethink my bruteforce then, I wasn't going to use ||recursion||
maybe you're already getting the same benefits ||memoisation|| provides through your approach? you could solve part 1 first and see if it takes too long on part 2
no, i’m just dumb
You think organically discovering Dynamic Programming is an approachable problem for the average computer programmer?
yeah idk if i'm being stupid but I can't actually figure out how to do even part 1
what was your existing idea that you said didnt need ||recursion||?
bad
lmao
||generate all possible combinations for things with itertools.product or something and then substitute them in and check validity||
never know until you start coding ;)
im 99.9% sure that's going to take a very long time
man idt a problem has...angered me since this one
like i coded a brute force solution that like tried to match up substrings to regions
that was taking too long
my first thought wasn't "hm, let's cache the results"
it was "oh this ENTIRE APPROACH" must be wrong
next morning, i code it up in like 15 minutes
and it works wonderfully
even faster than my 2d array approach last night
solved yesterdays problem (day 11)
and wasnt part 1 and part 2 the same??
||i just multiplied my prefix sum difference by 1e6-1 instead of 1||
how did other people solve it?
was there some solution for part 1 which didnt work for part 2
anyone still working on day 1?
depends on your implementation
||did people simulate the expansion?||
if you ||physically expanded the space|| then it wouldn't work for p2
i was thinking about doing it first, but i was too lazy to implement it
i can't get the second part of day 1 - my sample input works and gives correct answer and from what i can see my code is calculating correctly. but it's not getting right answer with the actual given input
i did
have you tried the ||oneight|| case?
implementing that wouldve taken longer for me
how did you guys solve part 2?
i got stuck on part 1 tho bc the test input works but not my real input
curious if there were other solutions i dont know of
||are we supposed to use djkstras instead of astar?||
today or yesterday?
There’s also ||twone||
today ig
yesterday
I did that for part1 but it was simple to then change that to a solution that works for both parts
haven't looked at today yet
how would you use d in yesterdays problem
it was just manhattan distance
shortest path?
and ||threeighthreeighthreeighthreeight...||
|||y_2-y_1| + |x_2-x_1| ||
it's a bit more complicated than ^ but yeeah
i spent 2 hours on it 💀
oh
||you only care about absolute change in x and y and how many of the expanded slots you pass||
you atleast practiced your d implementation
I ||kept track of the rows/columns that get expanded and checked one by one||
prefix sum is very smart
i still haven't finished d10p2 but i was thinking of j doing ||raycasting||
I got completely shut down by today's problem though. I tried learning ||dynamic programming approach|| but I can't use it in practice yet 😦 might come back to it eventually on an easier day
uh i believe i misrepresented the best method to you last night
there are at least 4 approaches that work and this was one of them
a ||brute force with caching(!!) is just much easier to understand and implement||
see my rant above lol
yea but due to the matrix only being 140x140, iterating and checking how many empty rows/columns were between each 2 stars wouldnt take that much longer
my issue is I can't even figure out how to ||bruteforce|| part1 😦
idk if my tenses are correct
yes
hm... I might try to figure it out, just having trouble finding ||the possible combinations while also accounting for what's fixed||
lowk might give up tho based on what ppl are saying ab d12 bc im like 3 days behind now bc of school
ray was defo the best
that's unfortunate bro
||walking the path and then calculating area worked for me because that was the easiest continuation of my part1 solution||
yea but what about the edge cases?
but my ray algo had some weird bug
the final result was 1 above the solution
I implemented it and it just worked 😄
dw me neither
what's ||dp?||
for day12p1 the solution looks like j ||brute forcing every combination and splitting it into their respective groups and then add any that match right?||
damn alright
💀
might have to switch to python atp ||i'm not tryna make a cache and allat for kotlin 😭||
yes, ||dp|| is basically just ||@functools.cache||
pretty good introduction
well ||top down dp is||
all numbers in todays input are one digit right?
There's a O(galaxies^2) solution and a O(gridsize)=O(galaxies) solution, which one did you implement?
first
iterated through the pairs of galaxies
||yea i trhink ill just do some recursion to try all combinations and see if they are possible||
for part 1
question on ab day 12
say u have a group requiring an arrangement of like 1, 2 and 3 broken springs
woild ###.##.# satisfy that or only #.##.###?
oops nvm
didn't read it correctly 😭
Guys for yesterdays qn part 1 , for sample grid isnt the distance coming out to be 384 instead of 374??
nah it shld be 374
for 1 and 7 galaxy they have given dist needed is 15 but shortest is 16
ru sure you're expanding the galaxy correctly?
0123456789ABC
0 ....#........ 0
1 .........#... 1
2 #............ 2
3 ............. 3
4 ............. 4
5 ........#.... 5
6 .#........... 6
7 ............# 7
8 ............. 8
9 ............. 9
10 .........#... 10
11 #....#....... 11
0123456789ABC
10-0 = 10
9 -4 = 5
10+5 = 15
You have an extra column before the one with 2 & 7, where did that come from ?
oh dear lord
we are on that stage of the aoc arent we
My bad. inserted 2 times
Thankyou
🙏 🙏
||dont simulate the expansion||
so I don't think I get day 12. bit too much for me
same 😦
||backtracking for part 1||
that doesn't really tell me anything XD
(my algo has a bug but ik that the idea is correct)
recursion
i know what it is but not how to apply it here yet. will give it a day or two
naive bruteforce for day 12 part 1 is fine if you can wait a few seconds
recusrion is just bruteforcing!
the dp thingy is a bit better than bruteforcing
and by bruteforcing i mean simulating each and every change with an ||itertools.product('.#', repeat=springs.count('?'))||
wow
what is the wow?
The first knowledge check IG.
I don't know about first. 5 and 10 were hard
5 and 10 are about coming up with an algorithm, 12 all but requires some basic knowledge of algorithmization techniques.
fair. I did not know about ||cash|| for instance. I'll think some more on it
I FINALLY FOUND MY BUG
TOOK ME 2HOURS
it was an obvious bug
but i wasnt able to find it
the bug was: ||if all blocks were used, i just added 1 to solution without checking if there were #s later in the string||
is day 8 part 2 ||supposed to be a huge number? its taking forever to run||
Yes
roughly how big?
14 digits
is that a joke
i dont think my 1 million steps every second is gonna cut it then 😭
yeah alright i figured out how to solve it
so is mine
Ok, I'll give credit where it's due, this was a good task. Part 1 easy enough to brute-force, part 2 basically infeasible with brute-force and you need to do something clever
what is the clever 👀
A lot of problems in AoC end up not doing the second
some flavor of ||dynamic programming||
I ended up writing the good solution for part 1 since I couldn't be bothered to write a brute force one and I kinda expected the twist 😛
dp isnt someting clever
its pretty trivial
im just bad at it
granted, the twist I was actually expecting was "concatenate all inputs"
I mean, something more clever than brute force
wdym?
yea it was obvious that my bruteforce wont work for part 2
but i just wanted part 1 to be done
and worry about the implementation after reading what part 2 wants me to do
in my head either approach was roughly equally annoying to write
the part that ||checks if the combination of damaged and operational records equals the contiguous groups||
I'm just not sure what you're asking about, the computation of the number of ways you can do things is what's being sped up
just the overall way of computing the answer
it's not just a small change to a brute force solution
the part i have trouble with is the ? being added between the string when they are added
idk why
(maybe if you ||did it recursive|| you could ||memoize|| and get stuff for free)
whats ||memoize||?
"oh I solved this (sub)problem before, let me re-use that result"
nvm there could be records with a "score" of 0 if the ? wasnt added
apparently the DP array for this is too large for PHP's defaults
yeah ok, trying to solve the task I had in my head might actually be quite hard 😅
huh, neat, ignoring the obvious issue of overflowing like crazy, C++ can actually solve that in reasonable time
~5s
so if the question was to count the number of ways modulo some number that would be totally doable
is ||itertools.product|| a suitable way to get all the possible combinations for part 2
mod 1e9+7
lol, I'm scared to even try
you'll run out of time/memory
what other ways are thbere
be more cleverer
||dp||
we did point to the relevant topic
idk how to ||dp|| it
i think you can easily solve this
mull over it ig
I'm kinda scared of the memory usage
C++ is already at like 750M I think
just for the array
actually...
you don't even need a full array
dp arr?
nvm idk what i wanted to say
ill try part 2 tmrw
but i have to study for exams too
this was how I defined my thing
||```perl
DP formulation:
How many ways can we put the first i segments into the first j
spaces. Also keep track of whether it's a forced blank from an earlier segment.
dp[i][j][forced]
thx
there might be nicer ways though, I feel like the last thing can be removed with some cleverness
3d doesn't really mean much
it's not like you're visualizing a cube or anything
and it's probably doable to get rid of the last axis, it just fir how I was thinking about the problem
i struggle with doing 1d dp
i wont be able to solve the coin problem in lesd than 30minutes
i cant even solve leetcode dp problems
I have
from typing import Final
x: Final[int] = 5
y: Final[float] = 3.5
I will prevail! eventually
soon™️
do the easy ones first, the easy dp problems sometimes don't even need dp, but kinda guide you into it
finally finished day 10 after trying to catch up
i used ||shoelace's theorem and picks theorem, pretty nice cuz i only had to add 2 lines of code||
I mean i don't think the basic concept of dynamic programming is difficult to grasp (if anything, the most confusing thing about it is just its name)
It's basically just recursing into subproblems and slapping a cache on it
I think the problem yesterday is approachable in the sense that like
there's not really anything clever in the transition
If you approach it methodically (for example, looking at the first character a time) and think through the possibilities you can pretty reasonably build out a recursive solution, it might just take some time because there are a decent few things to think about
And then from there realizing you can cache intermediate results to avoid recomputing things isn't too hard
I'm not saying it's easy but like, for example, a character-by-character solve where you see ?#?.?#? and think about the ? and how it can be either a # or a . and figure out that the state you need to keep track of is (chars left, current block, blocks left) to be able to recurse is actually pretty discoverable
There's only a tiny bit of additional state you need to keep track of that's not the problem itself, you don't need to do any clever transformation of the state matrix, there is a small fixed set of ways you can transition, you don't need any weird binary searches or math tricks to reduce
It's definitely not one of those things like if you either know it or not (e.g. CRT)
There's a clear sequence of smaller things to think about and solve to build up the solution, it's not like one big revelation
I agree with this
I think you could definitely figure something out just by doing cases by hand and a bit of thinking without any background knowledge in dp
Yeah
An example of a DP technique where this isn't really the case is the O(nlogn) solution to Longest Increasing Subsequence
where you have this weird transposition of the state matrix
and you binary search to transition
or even the O(n²) solution to Longest Increasing Subsequence since to transition you loop thru a bunch of previous things and sum them up
In the character by character solution there's only ever one state where you make two recursive calls
Every other state is either as base case or immediately reduces down to a single other state
I actually hate the name Dynamic Programming
it's the worst name in all of CS and Math
when i first heard it i thought it was something to do with like dynamically programming something itself like a dynamic website or sum
Then you were missing what my point was, which is that||, for most people, this isn't a possible day to solve if you don't already know the underlying algorithm.
Do you already have a foundational understanding of Dynamic Programming? Have you done a few problems in it, and understand the general approach to solving it? Great! You can figure out Day 12 Part 2.
If you don't have that, then this is a nearly impossible day to solve--to organically 'discover' the underlying problem-solving technique on your own. Some AoC problems are like that.||
You don't need to know the term dynamic programming to know about recursion or the idea of caching the results so you don't have to look them up again.
And if not, it IS perfectly acceptible and expected to google "how to make my code faster" or just ask here.
Language Roulette: Day 13
The language is ... Elixir
This is supposed to be a fund AND educational event.
oh no, only 10 mins left
10 minutes to start googling Elixir, and what is elixir. 🙂
https://en.wikipedia.org/wiki/Elixir_(programming_language)
Elixir is a functional, concurrent, high-level general-purpose programming language that runs on the BEAM virtual machine, which is also used to implement the Erlang programming language
if it looks hard i'm going to sleep 💀
should be a medium tonight
oh yeah cuz it's a weekday now right
still a week before the hardest ones
honestly idk why this year has j been harder for me, maybe it's cuz im doing it in a new language but day 5 & today were awfully hard for me 😭
I choked so hard on p2 yesterday I won't even call it a choke anymore
||I think if someone has good problem-solving foundations, it's possible for them to work out the recursive solution and logically think of caching even if they've not properly studied dp
but if the "average computer programmer" does not have solid problem solving experience it might be a bit hard for them to stay on the right track and implement it -- even if they thought about the right solution, without guidance or experience they might easily resort to thinking it wont work any point in time during implementation||
Not that I would have made top 100, but top 1000 is a good target.
I'm outside again so probably can't
sounds like bad planning
hope today isn't too bad
i try to finish early so i can start visualization early so i dont stay up all night
eh I'm on a trip
i think i gave up too early for part 2 today, bc i just tried to think of a solution in my head instead of trying to come up w a ||dp|| solution on paper
would be weird if I stayed inside all the time
wish i didn't live on the east coast for aoc lowk
why are you attacking me
Isn't it like 9PM for you there lol
That sounds entirely reasonable
I try to finish early so I don't have to do it during my afternoon classes
imagine furiously typing during a lecture
nah it's 12 am rn
it's unbelievable you can finish both the problem and the visualization daily, twice the work of most people
Oh yeah, got east/west the wrong way round mb lol
I just want to finish asap consume a bottle of nyquil and fall asleep.
At least you don't live in the UK (5AM)
damn wtf
i'll be properly burned out by the end of this month
i could never get up that early for aoc
You should come hang out in the solutions channel, we tend to help 3-4 people finish completely unique solutions every day.
my school timetable lines up perfectly for aoc
lunchtime is 12:45-13:45, aoc opens at 1pm
Lol nice
10s left, GLHF everyone
<@&518565788744024082> Good morning! Day 13 is ready to be attempted. View it online now at https://adventofcode.com/2023/day/13. Good luck!
I hope today's is ad-hoc
can there be multiple lines of reflection i'm confused why it says each line of vertical reflection
oh nvm
oh p1 doesn't look too bad
looks like a fun problem today
should be a quick leaderboard fill up unless p2 is hell
yeah this is the first problem in a while i've thought of a solution pretty quick lmao
j too lazy to get on my computer and code it
tmrw ig
I'm getting the wrong answer and I can't tell why :(
same
what does part2 even mean
Sub 15 minutes today
oh. somehow the first dumb guess I tried worked. wild.
maybe after some hours I'll understand why it did.
Wtf, leaderboard is full and I'm still stuck on p1
same
I rewrote my code halfway through p1 lol
I should have just done that from the start
after getting 2 wrong answers
what was even going on today
i spent like 10 whole minutes just on off by one bullcrappery
As far as I can tell my problem isn't even an off-by-one
I pressed backspace+enter now i have to wait smh
Doing it manually for a grid near the start of my input I get the same answer as my code
Also it passes the test
Like wtf
ru on p2?
No!
wait you're doing even mirrors and not odd mirrors right
?
Yes, 0110
hm
for me i just ||printed out the range i should be going through for each line||
Honestly restarting might be the move
There were a bunch of issues in my original code that i didn't know what was wrong
i personally would not recommend
so I just restarted and wrote it cleanly
I debug-printed all my ||mirror lines||, and all the ones I checked look right
if it's any comfort to you, p2 is trivial this time
That would be great, if I could get me p1 working
perhaps try larger grid sizes?
uh sorry i'm like kind of assuming that you're doing the same approach as me
which is really dumb
Are you maybe missing like when the mirror is at the rightmost possible slot
||all possible lines -> how far do i have to check for each line -> check that far||
!!
massive W
did ya get it
I did range(len()-1) because I thought that range(len()) would include a zero-range at the end
🤦
ah so that was the issue 
yup, part 2 was pretty trivial
yk for someone at #3 i've never seen advaya here
perhaps his sole purpose is to take #2 from me \j
?
oh wait jk it works
I thought I wasn't taking care of
the case where the left is longer than the right properly for a sec
Yeah, test data splits at 5
Yeah test data would def have caught it
Hello
I'm working on day 5 part 2 after finishing part 1 and I honestly have no clue where to start
are there overlapping seed numbers?
We're mostly saying the same thing. I think it's perfectly reasonable to realize "Hey, there's clearly some kind of algorithm or technique I don't know, I'll go look it up."
I just think the statement of "people could discover <insert algorithm or technique>" all on their own is silly, even if you have all the separate components. For some, yes, it will be possible. But for the majority, I don't think so.
||Try drawing it out on a piece of paper.||
okay, thanks
incredibly based
so glad i'm not the only person in here who feels that way, and then I see people like captain danger who are actually proponents of leaving certain qualities of the input that make the problem solvable (e.g. would otherwise be extremely difficult to solve or downright impossible) hidden, making that realization part of the puzzle as well
Moving my reply here:
I empathize with anyone for whom English is not their native language, because unraveling complex problems in a foreign language is a challenge!
But for native English speakers, I genuinely appreciate how the puzzles are puzzles, where the parameters and assumptions need to be teased out through experimentation or careful reading.
Do I feel dumb when I miss something that was stated? Sure. But that's on me.
...i don't think it has anything to do with understanding of english at all? Certain info about the input just isn't in the problem statement.
(ah, I guess you're probably responding to some complaint that's slightly different from mine)
It's a bunch of stuff in #aoc-solution-hints , but we were clobbering the channel from someone looking for help
also moving my reply here
^ this is a classic example because dijkstra's only works when you assume the input can't/won't have negative weight cycles
so they are obligated to tell you as much about the input
"assume the graph given has no negative weight cycles"
otherwise you would need to go with bellman-ford
not morally responsible. obligated.
they don't have a choice, and if they leave it out, people will dispute the question
and send in requests for clarifications
and i feel that aoc should be held to the same standard
and I'm glad at least one other person ( @woven solar ) feels that way
Except that the Advent of Code problems are solvable with the information presented.
subject to debate
It's not, though. It's empirically true.
You're not making an argument.
neither are you lol
in CP, your code is (generally) going to be submitted elsewhere and your code would be tested on hidden inputs. in AoC there is only one input and you can see exactly what that input looks like. I don't really see a point in emphasizing the constraints of the inputs in AoC.
except for ConfusedReptile's initial argument on day 8 (say, whether there are internal cycles within the input) which would actually effect the logic of the solution, and would disadvantage those who were trying to solve a general solution that covers edge cases versus those who didn't even think of the edge cases
Yes, I am, but it's shorthand. Here--
I'm still not sure if you're responding to my complaint. Assuming yes - I agree that they are. My complaint was that the AoC problems are simpler than they appear, which means if you optimize for solving them quickly, you'll learn the habit of solving the naivest reading of a problem rather than the general problem, and that habit would be maladaptive in situations other than AoC.
Statement: Advent of Code problems are solvable with the information presented in the puzzle.
Proof: Every single advent of code problem published to date has been solved.
So - that's a much more interesting argument.
And I think it's a reasonable criticism of Advent of Code if you look at it specifically through the lens of practicing for Competitive Programming.
in all fairness from my POV this was never about practice
aoc is far from an adequate modality for practicing competitive programming (but this makes sense / is not aoc's fault, it wasn't engineered to be as such), so i was never really expecting it to be anything more than something fun to pass time
but at the same time picking apart the language used in the problem statements to surmise certain things about the input is just not fun
Is not fun for you.
aoc is nice because I'm learning new things
@broken dock It's perfectly reasonable to be dissatisfied with aspects about Advent of Code. That's one of the joys of humanity--getting to have opinions about things. Making grand declarative statements about the way it should be or how you would change it if you were in charge... all good things to do.
there have been a number of instances where I felt like I would like to have a word with the problemsetters just this year alone rofl
at least four i think
wonder if aoc has any official channels to communicate feedback to them
The creators are active on reddit.
do they have certain flairs on their profile
They do.
alright goated, i'll just send them dms
although i'm certain there's gotta be a better way of reaching them
I would post an open thread for the discussion.
i don't want to discuss, i want to share my sentiment with them directly and hear from them, directly
we're already discussing here and i've gauged at least a few different perspectives on this
You're much more likely to get a response in a public forum than in a private message, but you do you.
so as far as reaping benefits from a discussion, that's already been done
Three final thoughts:
- You seem stuck in your mindset and your opinion. You didn't acknowledge my objectively correct statement or offer any kind of rebuttal... it seemed to float past you. That's not so surprising given your age, but it's something you'll want to work on as you grow older.
- I would challenge to you would be to adjust your mindset. Don't judge Advent of Code for its deficiencies compared to the standards of Competitive Programming. Judge AoC on its own merits and what its creators are trying to accomplish, and ground your suggestions for improvement there.
- I would strongly encourage you to post in a public forum versus directly messaging the people running AoC, especially given that you haven't even been able to find the creator's email.
Personally I think that the way you've been approaching this conversation has been pretty condescending
There's been a lot of picking apart people's words rather than trying to understand them
Ironically that's sorta related to what a lot of people feel about AoC in general
- No arguments have, as of yet, been made, I have established an opinion, and you, yours. Moreover, you know nothing about me, so please do not make any assumptions.
- I acknowledged this in #aoc-solution-hints
- No, thank you.
Especially the remark on gian's age I think was wholly unnecessary
Wildest part is I know he doesn't know how old I am
I think my remarks have so far been pretty tame
so that comment certainly came out of left field
if i'm wrong and anyone has been in some way offended, by all means, please let me know!
The age comment was unnecessary. I was going off your linked website which said you're 18.
ah, my linkedin must be outdated, then
my birthday is on dec. 1st (when aoc starts :) )
Happy (recent) birthday!
Nice chatgpt
Jk jk
ChatGPT is less condescending than that
In all seriousness, thank you for the engagement @normal dragon, I'm aware judging two different things through one lens usually yields one-sided thought patterns like mine, I've only recently started branching out from competitive programming (that was my introduction to computer science, and my segway into the tech industry), so I know I have to keep an open mind with this stuff
You're very welcome. It was a good discussion, and I hope you got as much out of it as I did. ^_^
you can specify that.
To @broken dock and everyone else: I’m sorry for coming off rude and condescending. I was in a bad mood, and I like arguing, and I didn’t temper my words. My goal was to help, but I lost sight of that while trying to win the argument instead.
having to look at your input to be able to solve the problem is terrible
wjat happened?
who had the correct opinion?
no one
looking at your input is a terrible idea; that's way too slow 😛 you just hope.
i have my reasons for feeling the way I do
danger has his
and that's pretty much it

my opinions are always superior

if you disagree with me, you are wrong and probably dont know enough about the topic
Ja
Ja
please use #1047673173447020564 for sending solutions or at least send it as spoiler ||code|| like this
if you need help with solution use #aoc-solution-hints instead
@low lodge What Down said. Please use the spoiler channel for posting AOC code. I've removed the message.
Sry i ve posted in aoc solution hints
How I solved ?
The niceness of a pair (a, b) is the value you will get by subtracting their product from the difference of their squares. For example, the niceness of the pair (7, 4) is 5, because (7²-4²) - (74) is 5.
Find any pair of numbers with niceness 500, where both numbers have 4 digits. If you find a pair (a, b) then write the number (10000a)+b as the answer.
ask in #1035199133436354600
I recently discovered the library icecream and have been really enjoying using it for aoc problems. "Never use print() to debug again". When you use ic to print, it prints the variable names too, pretty prints structures, and even includes syntax highlighting.
yeah use debug to debug
what ide are you using?
gotta give it a try
that sounds awesome what
Neovim. I do sometimes run a debugger, probably not as often as I should, but it depends on what I'm trying to do. If I want to understand where one specific example is going wrong, yeah, a debugger is the best tool, but if I want to see a summary of values to, say, identify which example I should focus on. I've started using breakpoint() more in my code, which is nice since you can throw it in any code without needing to start it specially with the debugger or anything.
i've been working with vsc and basically only using the debugger
Ong
learning how to use the debugger is a key skill.
(sometimes print is not enough)
debug when I know where I want to stop and look.
print when I need to see what the value on loop ~500 is.
Spamming and over using techniques when you first learn them is excellent practice and a great way to learn. Easier to push boundaries and break things and learn to pull back than not knowing where the boundaries are when you need them
is advent of code something you can do with pretty much no experience
i took a look at that and it is absolutely fantastic
tysm!!
Kinda depends what you mean by no experience. If you know the basics of Python, and can do basic problems, there’s a few that you could solve… but there’s also a few that are probably too hard. But the easy ones might take a while, just to manipulate the data into a format you can work with. I’d suggest asking for a suggestion for a simple one to try, and asking in the hints channel.
so far i only know the basics really
Might be a little tough, but take a look at today’s problem. Anyone else recommend another easy day?
alr
day 1 part one should be doable
else day 4
I still need to start 🥲
Check out some of the Day 1 problems from earlier years. You can access them all right here: https://adventofcode.com/2023/events
https://adventofcode.com/2015/day/1 -- the very first puzzle released is a great 'first puzzle' for a Python beginner.
Good luck!!
day 6
4 i think was pretty straightforward
i know of a cabal of ~beginner programmers that mostly got it
2 too
day 7 part 1
Yeah, I also like the feature where you can just leave an empty ic() and it'll print the location... a much quicker way to do "reached this point" type printing
hello 🙂
icecream is awesome for debugging and logging
Bruh I just realized
I'm going to be on a plane on the 20th, 21st, and 23rd
gonna have to buy the in-flight wifi and try my best to do aoc 😭
aoc in the air ✈️ ✨
Language Roulette: Day 14
The language is ... Dart
GLHF everyone
GLHF
<@&518565788744024082> Good morning! Day 14 is ready to be attempted. View it online now at https://adventofcode.com/2023/day/14. Good luck!
man
discord has a weird push notification system
since this server is big enough and whatnot
I viewed that message on mobile and then closed the app
then got a notification for it
today looks fun
have a 40 min train ride soon so hopefully I can finish in that time
I'm getting 87 for the sample for p2 lol
|| while 👀 What on earth is part 2? ||
sobbing
||do things lots of times||
||ohno||
Uh oh this isn't good
Whut? 😮
How do you do that. Can you give me tips on that? I mean, I quickly looked at the puzzel for today and my first thought was: another bunch of periods and hashtags, how will I have to handle them this time??
I need those 40 minutes just to get an understanding of what I need to do.
What skills am I “missing” ??
Are you adding to the dict before checking the dict?
Don’t get me wrong: I’m definitely not asking for the solution to be handed over, as I want to solve them myself, but the last few days, I seem to have a lot more trouble getting the input into a form I can do something with it.
I’ve been working with JavaScript so far, as I’m a bit more familiar with that now, but those hints I’m looking for are not language specific.
what was the issue
Honestly a lot of it is just experience. A lot of puzzles have some common parts, and a lot of real life programming problems have similar common parts. Binary searches are commonly taught for a reason--a lot of time you need to search something. Some folks are really really good at flexible thinking, and noticing how a puzzle needs a common component. But you don't get there until you play with a wide variety of problems and puzzles. It's just going to take a while of figuring out how to view a problem, break it down to smaller, known problems, and tackling those so the big issue is simpler
Hey, this is on-topic smh
||literally just running the spin cycle the wrong way round, clockwise instead of anticlockwise||
oh nooo 😭😭😭
90% of my time in part 2 was that stupid bug lol
(explains why I wasn't ever getting 64 for the sample lmao)
I'M GOING TO COMMIT MULTIPLE FELONIES
I READ IT WRONG
I DIDN'T KNOW
A CYCLE WAS ALL 4 DIRECTIONS
I THOUGHT A STEP WAS A SINGLE DIRECTION
LIKE NORTH ONE, EAST ONE
ykw i'll settle for just being on lb at this point
I've done 2 years of aoc before this, so I'm kinda used to this input style
Another useful thing is lots of people use utility libraries
For example, ||aoc_helper.Grid|| is quite well-suited for today's puzzle
Personally I don't think it provides that much utility if you've worked with the language a lot
parsing is hard sometimes though
idk what part 2 is, but from the comments here ||is it about detecting a cycle from shifting north east south west north ...?||
Idk, ||rotate_anticlockwise|| and ||rotate_clockwise|| were nice, in addition to the ||from_string constructor||
Kinda
(you're doing it ||a large number of times||, so you de-facto need to do that)
today is pretty much a slight modification of that tetris task from a year or two ago.
😭😭😭😭
yeah I thought of the tetris task as well
Today's part 2 is classic aoc
bro i spent way too long on checking modulus off by one etc. etc.
perhaps i should make some notes related to that
🤝 stupid bugs from not reading the question properly
At least you didn't also have my bug
:P
man as soon as day > 10 my placing just 📉
Tbh I kinda find the opposite, in that lb spots usually take longer after day 10 so my being a little bit slow to write the code usually doesn't matter as much
OTOH stupid bugs might occur more like yesterday oh god
I'm def faster on faster days compared to slower days
i guess you're just better cuz
bro i'm washed as hell it's not even funny
Yeah, me too
how do i get my brain to tell me funny elves are not the same as a life or death situation
My dropoff for p2 was also pretty bad because of that bug ._.
I have to get ready to go to the office, but can you tell me more about “binary searches” in this regard (or point to a good source?, I don’t mind reading in)?
Last year was my very first attempt at some after I heard about it for the first time.
uh searching for # in sorted array
you can do it by looking in the middle
if too low, that means everything on the left is not worth searching
(I haven't read todays problem, it probably doesn't apply to it, but was a generic example)
if too high -> everything on the right
you keep on doing that till you narrow your range down to a single #
Are those libraries “ready made and available” in Python, or is it something people created themselves?
!pip aoc_helper
both
starwort suggested that library, i just code some stuff myself
(but yeah people have offline ones too)
Thanks so far. I’ll catch up later.
asked chatgpt to help me reduce some voodoo math, and told it the correct answer.
start = 114
r = 156
print((start%(r-start)) + (start-1))
# 143 (it said 119)
print(r+(start-1))
# 269 (which it got right at first, and then bizzarly just said it's 143)
today was fun!
I liked it a lot
Vim

Today sounds fun
I still am stuck on cosmic expansion
big hint if you want: ||there is no need to do the actual expansion||
Practice and experience
Last nights solution is one of the reasons I enjoy aoc: I found something new. the second param to re.sub can be a function/lambda.
spoiler thread for the curious: #1184725793826422844 message
It takes me more time than that to read and type. 🙂 Never mind think.
You ignore 90% of the puzzle text :P
i hate chatgpt
i hate regex
It's a pretty simple regex though. '[.O]+'
You can get a lot of utility out of very simple regex without it turning into a giant mess.
It’s a slippery slope from that to RFC 822: https://pdw.ex-parrot.com/Mail-RFC822-Address.html
/s
Regex’s are super helpful, though I don’t find them particularly fun to use in Python.
Hello, please don't spread misinformation and spam in channels. Thanks
how can it be misinformation when he solved all days for me for now 😭
We dont care, move along
rude @ripe meteor
i'm way behind. day 8 seems to be a doozy for me. but i think i can do it
You 100% can do it!!!!
where's visualization by the way?
yeah, found that. it seems so hidden, but i understand why
It's great if you've been able to ask chatgpt for help and get useful information, you're essentially doing enahnced googling. But chatgpt absolutely has not been able to solve all of the aoc problems. If any.
day 8 should be easier than day 7, so you can do this. ask if you get stuck, or check the solutions channel for help/hints.
i'm not using a generic language for these challenges though. but, still confident i can solve day 8, and if i want, all the days after that
if you got part1 done you're in good shape. after that it's a matter of realizing there's a technique to shortcut part 2. You won't want to brute force it.
That comment probably applies to many of these problems.
What are you using?
I doubt chatgpt could solve any part to any of these problems just from the input text
G'MIC. A Domain-Specific Language designed from bottom-up for creating/editing raster graphics images with some 3D capability.
sometimes, the only trouble is parsing string to easily parsable images. at the end of the day, everything so far can be broken down to numbers
chatgpt also seems to be under heavy load lately, I've been getting really crap answers from it on simple things like "how do I simplify this math expression".
I haven't used chatgpt much tbh, I'm satisfied with copilot and even that is often more distracting than helpful
microsoft's cheeky labeling for chatgpt4 enhanced help "Bing is your AI-powered copilot"
that can't have been an accident
lol
i wish chatgpt and others just say to people "learn to code" next time
They should at least have a warning "you'll need to know how to code to figure out this untested crap I'm giving you" 🙂
it does explain code that does work somewhat well. for that it is useful
I haven't started aoc and should but I don't even know how to make a proper function without getting a syntax error 💀
This year has been pretty hard for newbies. Other years have been more gentle!
The first AOC Problem from the first year is very doable for newbies to python.
thanks
Feel free to ping for help if you need any! AoC is great :D
I've tried aoc with rust but not with python so I don't really have the pythonic wisdom
I wanted to do this and it turns out github copilot remembers the whole solution 😄
Well you could just ... turn off github copilot XD
I know, I was just surprised 😄
Good time to start learning! Ask as you go and learn as you go!
say 1 this year felt a little harder compared to day 1 last year, but it was still in the range of "easy"
thank you :)
You'll find there are a lot of people here that are happy to help anyone that is motivated to learn. 🙂
that's very encouraging, thank you :)
school made me miss three days 😩
good ol' aoc with "great! now for part 2, ||repeat what you did in part 1 one billion times. what is the answer?||"
this year's day 8 has taught me to ||not overthink - if you see a cycle, go for it|| :P
so i hypothesized ||there will be a cycle||
i tested, and ||there was indeed a cycle||
now it's just a matter of if it works, it works :P
day 8 taught me to read a little harder
it takes forever to do Part 1 if you don't start at the appropriate place
... and solved ||using a cycle||
just like day 8, feels like cheating :P
if it works, it works
||there has to be a cycle by the pigeonhole principle||
i'm close to wrapping on Day 8 😄
||ah thank you i was wondering how to prove it but i didn't know where to start||
||proof would go like
each tilt of north west east south can be modeled as a function f that takes in one board state and outputs another board state
there are a finite number of possible board states (for a loose upper bound take N= 2^(board size))
define g(n) = f(g(n-1)), and g(0)=starting board state. Then, in the sequence g(0),g(1),...,g(N), there are N+1 values, so by the pigeonhole principle there has to be two values s and t with s<t s.t. g(s)=g(t), which means that after s applications of f on the initial board state, or g(s), t-s applications of f will return back to g(s), which is a cycle, so there is always a cycle
||
let's gooo! excited to see your solution :)🎄
||if there is a much larger number of possible board states than N + 1, where N = 10**9, how can you apply the pigeonhole principle?||
||nothing constrains the sequence g(0),g(1),...,g(N) - they can very well be all different game states, no?||
||N is defined to be 2^(board size), which is an upper bound for the number of possible board states||
||there are looser upper bounds you can have for this problem, but just any upper bound works||
oh okay, i misunderstood ... but even in this case ||who's to say the cycle period isn't MUCH larger than 10**9?||
||wdym by 10**9?||
^ (i would assume mathematically)
||the proof shows that the cycle length is bounded by N as well, since it is at most N-0=N||
yeah, and so ||the cycle length can be much larger than the number of times we need to spin the platform||
oh you mean for this specific problem
yep
maybe
OHHH you meant in general
well, i had to use a mixture of languages, the day 8 part 2 answer does not fit in a double too well
yeah of course in general ||there has to be a cycle bc there's a finite number of game states||
||2^board size is a very loose upper bound, it's possible the number of board states can be reduced||
definitely, but through whatever reduction ||it's still >> 10**9||
actually i'm unsure
yeah
maybe it can be significantly reduced
possible reductions are:
only consider spaces without #
only consider states where all rocks are touching something to the north
2nd one is fairly large
1e9 is quite small tho so I still don't think that's guaranteed
there might be other possible reductions
either way ||assuming the existence of a small cycle is a feasibility assumption imo, which I'm personally fine with||
My logic went like this: at 10,000 searches per second it would take over 24 hours to search a billion iterations. Ergo per AOC there must be a better way. ||Cycle seemed a possible choice so I tried that first.||
my logic was ||this reminds me of that tetris problem last year I'll just do the same thing||
It would be interesting to see the distribution of cycle sizes over all possible boards
Ha valid, Now I have to go find that one.
My wild guess is that in fact most boards enter a limit pretty quickly
It's pretty easy to test actually
i feel the same intuitively yeah
I’m sure Eric designed it that way
Heh, I thought the same thing
but I didn't do the same solution. I thought: ||a billion is not such a large number. I'm guessing that it must cycle, but rather than make any attempt to determine the cycle length, I'll just throw a @functools.cache on my function that does a single spin cycle, and see how long it takes to do a million iterations. Turns out: "fast enough". That basically reduces it into a billion-ish dict lookups, which only takes ~2 minutes on my laptop||
lmao
took less time to run than it would have taken me to code something better 😄
what kind of prompt is day 9?
am i allowed to post paste links in #aoc-solution-hints ? im kinda stuck on the second part of todays problem for a few hours already, just cant get it the way i want, and im not sure if there something im missing or everything is just a totally mess
go ahead
we have a pastebin btw
!paste
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
WHO'S READY FOR DAY 15?!
anytime now we're gonna get a really hard problem
GLHF
GLHF!
In -3 days :P
just in time
Now Ill just read and laugh.
<@&518565788744024082> Good morning! Day 15 is ready to be attempted. View it online now at https://adventofcode.com/2023/day/15. Good luck!

YES
121/35 let's go
I spent time in p1 checking that the input was really one line because the way the puzzle was worded made me think p2 was going to be like 'now there's 2 lines, don't ignore the newline'
LB full
i had to do a test with the test input which probably caused me to have a much lower rank
Wait I just realised, we didn't get a language roulette post today
Do you reckon kat is asleep
maybe
lmao today's reading was ass
I threw today because of reading comprehension
and yet you still got #20, curious
511/342
People were slow on p2
I gained 90 places lol
i had to do an unnecessary from collections import defaultdict
wait so how do you know which box to put the new lens in
that's why you have it preimported : )
and faced a problem with mutability
||(b = [{}]*256)||
||hash it||
||hash function from p1||
Hash it
i had to reread the part for = so many times
I can't have been the only one struggling to comprehend LMAO
😭😭😭
I kept thinking the symbols meant something for p1
gotta wait for the screen reader
||If there is not already a lens in the box with the same label, add the lens to the box immediately behind any lenses already in the box.||
this confused me so much
When really you have to ||throw the whole thing into hash||
I was getting worried about the 'ignore newlines, it's only one line' comments lmao
i was just confirming that || it's just normal dict operations||
I imagine it's because trailing newlines would change the answer?
like, you're just describing a ||dict|| right? right?!?
i mean a rogue \n could easily change the hash
But the whole thing was one line
i did input.replace("\n", "") cause i got scared
I mean probably but like, if someone's copying the input wrong that's on them?
was there a newline
No
oh
the problem made me paranoid
ah i rstrip my input
i literally wrote ||if x != '\n':|| just in case
How about the ide auto-inserting newlines
Yeah same here, I actually checked with shell commands - I really shouldn't have done lmao
someone else can open the spoilers for day 15 right..?
This is why you use an automation library
Fair enough
yk salt i'm a bit surprised you aren't mod
i've never applied, i don't want the responsibility
haha relatable
oh i just download it from the input page
so far they all end with a newline
iirc they didn't always in the earlier years
They need to get the language roulette as well
That's just how Eric's server software works
Language Roulette is ... Brainfuck
let me bug them in the aoc channel for us helpers
Automation libraries will remove the extra nl btw
there's a special aoc channel for helpers?
ok
oh yeah, i did know the language for today
my part 2 took 10 minutes longer than part 1 but still somehow landed me on 158
I didn't know the hit board game Go was Turing-complete
i guess this is how important milliseconds are in the leaderboard
i do a lot of really slow things, i'm not really meant for competitive programming
but i try
Holy shit lmao
now let me rename all my variables to be lore friendly
So like, any progress? Lmao
This was a nice easy puzzle today
no one's responded
we have an aoc channel for helpers?
i know kat said she was watching a movie earlier and couldn't do it, and dawn couldn't
yo aboo to the rescue
i pinged xith cause it looked like they're online
I'm surprised it doesn't just get posted automatically
if aboo can do it that'd be awesome
it opens after leaderboard fills up
i was gonna ping aboo, but then they went offline
It's hard to automate because it's supposed to be 'once leaderboard fills' and we don't want to DoS AoC lol
Language Roulette: Day 15!
Sorry for the delay ~ today's language is......Go!
30 minutes woo
thank you aboo!
can someone make the solutions post
the heck does it mean by ||ignore newlines||
||the trailing newline at the end of the input||
yeah, I got that wrong at first 
I also thought "what kind of red herring is this?", ignored it, and promptly got the wrong result
I always remove mine so
I thought 'what kind of red herring is this', didn't ignore it, and wasted like 20 seconds checking the input only for the answer to be to do literally nothing
I always ||strip the newline of my aoc inputs||
me too, I just missed it this time and couldn't figure out what I'd done wrong for 30 seconds or so
I even threw in an explicit loop, and then I was ||confused by the blank line|| that showed up in the output before it finally clicked what dumb fucking thing I'd done
🤦
If there's one thing that AoC taught me, I can't read
I copy paste the same AOC file for every day... I've got all of my convenience functions just pasted at the top
I'll do you one better: aoc template all
Sure I could do that, but that's more effort 
(it's literally one command you run at the beginning of the event and it generates the files for each day)
I copy paste from one day to the next, but yesterday I had a ||.read().splitlines()|| that became a ||.read()|| today since there was only one... 😠
((you can also say, e.g. 16-25))



thank