#advent-of-code
1 messages Β· Page 26 of 1
GLHF everyone
<@&518565788744024082> Good morning! Day 5 is ready to be attempted. View it online now at https://adventofcode.com/2024/day/5. Good luck!
ok
day 5 is out
19/15 gg
i dont understand day 5
anyone know how make money π€
i dont understand day 5
report
my question refused to open up for like a damn minute. ridiculous. 182/102 π
My ranking's gone-
the leaderboard filled up crazy quickly though! I finished both parts in 3:45 and i'm still 102
crazy
my code was so dirty, used eval lul
please help
could be an AI. who knows
you're #2. WTH congrats @compact wasp !
yeah honestly i suspect it
considering their poor time yesterday for pt2
though ig it's also possible to just make mistakes lol
i'm honestly surprised that the entire leaderboard was filled....and I finished both parts in 3:45!
possibly!
i'm anyways gonna be off the leaderboard soon since I'll be travelling mid December to a place with no network for a good few days :/
it was great while it lasted lol
Day 5 β
hydrogen fluoride?
wtf insane
yeah
i'm probably gonna get bored like last year and dip before the first week is over π
we'll see
i need to beat secemp first
did you finish last year?
nah
i went out with friends on day 7 or 8 and then just didn't pick it back up again
lol nice
π
saro right?
yea
i dont rember π
he said "look at this golf my friend made" and it was the same one we were working in this server

wtf you guys exist irl?
welcome back
I was a dumdum with part 2 today. Tried to bruteforce with itertools.permutations(). I waited for like 15 minutes for my script to finish. Then it hit me
is eniraa so high up on global but
Damn! Congratulations!
wtf god
(in pydis lb)
missed day 1 and got server diffed on day 2
set me back a ton of pts
don't think i'll ever top pydis bc of that lol
it's not competitive enough
yeah lol
would i ever know if i was flagged as a spammer? 
i will inform you
perhaps it is the unnecessary caps lock that got you flagged
zD
):
this is reason i think so ):
@sullen adder
wtf
how do u know i use opra
osint
wtf
how u know>
8
tell me
hmmm.....
ur right
but i dont use opara gx for discorde
@sullen adder
le me show u
ah, once i created an alt account and it got flagged instantly due to the browser i created the account with
ooh nice background
i'm good without
lmao bro got flagged
What is the best way to do day 3 without regex? Just parsing it with x = "" and x += inp[i]?
yeah you could definitely do that as long as you verify yourself what is being appended
idk it always makes my code so unreadable...
ask in #aoc-solution-hints
Oh god, part 2 of todays puzzle was so simple, but it took me one hour π€¦ββοΈ
I probably did it in a weird way to be honest
I thought something similar to day 2 p2 was needed but then thought to try a ||sort with a custom key function|| and it worked
if you've studied ||topological sorts|| you can recognize the problem immediately, and if you have a library for it ready to go then it might possible to solve in <1min
yeah though some people accused of cheating idk
idk if i'm being a sore loser but sounds like copium lol
people expect top lb to have a lib for everything, but i doubt anyone has a lib for the problem of today
though i may be completely wrong
nx handles sorting
parsing also isn't too difficult
but i still don't buy it lol
I mean the whole thing was not rocket science, but 55 seconds...
yeah my thoughts exactly
me doing aoc
does aoc -> can't do anymore aoc because no time -> lost motivation because im not caught up```
meirl
that's gonna be me tmr because I have a flight
Good job, hope you will keep the pace
I find it unbelievable as well, but other players have managed similar times. I just wanna see a screen record of them actually doing it tho
Someone got day 1 in less than 10 seconds. It takes me more than that to just read the problem!
Would also love to see that
That was AI 100% iirc
yeah some people are confirmed to be using AI, not even trying to hide it
Then we shall mock the 10s as being horribly slow, instead. /s
I don't mind other people using AI. The rules don't prohibit it either.
do people not read the lore
it takes more than 55 sec to read what youre meant to be doing
absolutely despicable
Can I use AI to get on the global leaderboard? Please don't use AI / LLMs (like GPT) to automatically solve a day's puzzles until that day's global leaderboards are full. By "automatically", I mean using AI to do most or all of the puzzle solving, like handing the puzzle text directly to an LLM. The leaderboards are for human competitors; if you want to compare the speed of your AI solver with others, please do so elsewhere. (If you want to use AI to help you solve puzzles, I can't really stop you, but I feel like it's harder to get better at programming if you ask an AI to do the programming for you.)
Shit you're right... Those AI mfs
The lore is the best part. I'm doing this for the story.
I want to find out what happened to the Chief Historian!
probably in some ditch digging for artifacts
instead of doing the job they pay them for
academics amirite
i will be vindicated
things heating up in the advent of code fandom
You are not allowed to use that command here. Please use the #aoc-bot-commands, #sir-lancebot-playground, #bot-commands channel(s) instead.
yk there are several leaderboards, right?
gotta use
&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.
L
let's see if this becomes forth or forthfit
why not https://github.com/tsoding/porth
Why is 13 always in the end? Couldn't it be in any place?
or am i misreading something?
You have the rule 29|13, so 29 must come first
From what I remember, 13 doesn't have a rule in the test input
it does
ohhh
As in it isn't a "leading" number in the rules
that's why
ah yeah
Ocaml mentioned
See y'all in 6h, gn
OMG I actually did Day 2 Part 1 in Smalltalk
holy based
good god, I think I've run into a gforth bug or something
oof what happened
writing to one cell in memory seems to write to 4 cells, so modifying one cell affects surrounding cells
like wtf
Create pred 20 cells allot
: main ( -- )
pred 0 20 cells fill
1 14 pred + ! \ write a 1 at offset 14
12 pred + @ cr . \ read 65536 at offset 12
;
main
so lookup and setting values uses different sizes?
oh
is the offset the issue? 
that would actually make some sense
yeah cells gives number of address spaces for input cells
at least it's a trivial fix for how I wrote the code
: pred_at ( n1 n2 -- ptr ) 100 * + pred + ;
\ into
: pred_at ( n1 n2 -- ptr ) 100 * + cells pred + ;
this wasted so much time π
hours of debugging
oof yeah it's like working with an array of ints but all you have is a char *
and you can't cast the initial pointer so you're doing int x = *(int *)(arr + i*sizeof(int))
part 1 done π₯Ή
finally - Day 2 Part 1 and Part 2 - in Smalltalk
I never want to touch the language again
my solution is in the Day 2 channel if anyone cares
it wasn't that bad
I really struggled figuring out wtf to do, especially initially with GNU Smalltalk
With Pharo it was much easier but I did need ChatGPT to give pointers on what methods to use
actually the language is ok - I just don't enjoy it when there's a lack of good searchable resources on how to use specific stuff. I found Vimscript easier in this regard at least
forth kicked my ass
literally never even heard of forth. Or elm for that matter
Awk I have heard of though
the other lesson I learned is that I really take good intellisense / LSP for granted
Pharo strikes me as being powerful if you know what you are doing; and just absolutely impossible if you are clueless like me
I'll need to come back to forth
May the forth be with you
all my homies love printing with side effects
stickie #4 global when
i wish
i'm barely top 1k as it is
haven't even leaderboarded yet
with his margins he doesn't need them to lb
ofc he gets destroyed on many early problems but utils are less important for later ones
make it happen π«‘
gonna be tough considering i currently have 0
winnable tbh
<@&518565788744024082> Good morning! Day 6 is ready to be attempted. View it online now at https://adventofcode.com/2024/day/6. Good luck!
everything logged out from my browser today at the last minute. Still pretty slow p1, still was able to get to leaderboard on p2
245/50
ripp
my p2 was pretty inefficient as well. took like a fair 45-1 minute to run
yeah smh imagine ranking below tessa
ok buddy
is there a way to link anything else except github with your AoC account?
I don't see a way to put a link anywhere
Yes, but you must do it on register, you can on link one account per AOC account
You could: Register a new account and transfer the data
lmao this is the most reactions i've gotten on gh
ruudddeeeeeee. lmao
ohh
But you can transfer into a new account made with another sign in method
||i was tripping at first. i solved it as how many starting locations would end up in a loop||
Oops!
Rip
Anyway I want to know why the Historians think the Chief would be in 1518 lmao

lol
if only
in the time it took first place to solve p1 I was looking in the spec for where the guard's starting pos was
ohh, i checked and they don't seem to have the linkedin option lol
10s??! wtf
i wouldn't be that fast even if I had the solution already ready with me π
Rip
Do you not even use an auto library lol
If I started with the solutions I'd get <1s lmao
same, i just type it out OR usually copy paste from terminal
bro's really trying to dox himself
i just realized i could just drop out and probably still make top 100 by the time this ends

ok standing in line coding kinda sucks but i did p2
prolly gonna fix up my solution to not take 5 years tho

My code still calculating the result that I don't even know if it's correct or not
yeah that's how it is
Should have sorted it so I know the progress
...how did my code checked 6k location when I only gave it 5k to check π
congrats!!
...how it stuck itself in a loop of re-checking
nvm, turn out I am stupid and forget to remove a print statement that confused me
damn, first part 2 of the year to stump me.
ong might be time for me to add tqdm to my list of libs
Brute force too?
I still can't find an efficient way to calculate part two, I did it by brute force. 
i assumed brute force would be too slow, but i suppose i should just try it
I also assumed brute force would be too slow
can confirm brute force takes ~3 seconds in rust
my bruteforce takes ~2 seconds in python
by brute force what exactly do y'all mean
can see my sol in #1314458544367603712 message
move it by one position each
||placing a blocker in each tile, and testing each time if the guard takes more than a certain threshold of moves to exit||
||don't need blockers on tiles the guard won't visit||
||true, I just threw something together quickly - and in those cases the guard should exit the map fairly quickly so the simulation shouldn't take that long||

day 6 was fun :-)
Way too slow
Checked 1k/5k
And also, I haven't got a simple valid placement in 1k somehow
And turn out I forgot to write the logic of checking π₯΄
Aight I'm out
I see grids I say byyyye
rewrite it in rust
Part one was brute forceable with regex sillies, but oh no for part two I'll have to actually think ;-;
ping?
got part 1 done in 13min, had the code for part 2 done after another 10 and then debugged for almost an hour bc I didnt see that I used the walking dir at the end of part 1 for my part 2 input and not the original one D:
help me d4 pls
d4-2
The Elf looks quizzically at you. Did you misunderstand the assignment?
Looking for the instructions, you flip over the word search to find that this isn't actually an XMAS puzzle; it's an X-MAS puzzle in which you're supposed to find two MAS in the shape of an X. One way to achieve that is like this:
M.S
.A.
M.S
Irrelevant characters have again been replaced with . in the above diagram. Within the X, each MAS can be written forwards or backwards.
Here's the same example from before, but this time all of the X-MASes have been kept instead:
.M.S......
..A..MSMS.
.M.S.MAA..
..A.ASMSM.
.M.S.M....
..........
S.S.S.S.S.
.A.A.A.A..
M.M.M.M.M.
..........
In this example, an X-MAS appears 9 times.
Flip the word search from the instructions back over to the word search side and try again. How many times does an X-MAS appear?
it is such a pain in the ahh
30mins and nearly done (in python)
My code took a noticeable amount of time to run for part1, and with part2 ||off the top of my head, I can't think of a strategy other than brute force. Good thing I'm using rust and going release mode. Hopefully, by the time I figure out and implement an efficient solution, my brute force code will have finished running||
Checked 5.1k/5.2k
i already have my name on AoC, so really doesn't matter lol
also, my linkedin cz I wanted to flex my vanity url lmao
any edge cases at part 2 today?
i don't think so 
my solution works fine with the example, i can't possibly debug the input
why can't you debug? print is your friend here imo
Debug difficulty for me:
It took 30mins for a full run to get a result
I don't know something wrong until 30mins later I submit the answer and it says I'm wrong
i am curious what your code is doing π
Running part 1 5000 time with each possible obstacle (path in part 1)
And my part 1 wasn't really optimize
use a set
Might be the issue, I got the answer so...
?
what piece of an x shape would let you find the whole shape faster
||A||
d6-2
solution works fine on example, but not the input.
produced by solution (which is correct):
....#.....
.........#
..........
..#.......
.......#..
..........
.#.0^.....
......00#.
#0.0......
......#0..
6
day 6 part 2 π
isnt this a spoiler
no, this example (and it's solution) is within the question
but the second part of the question is only revealed when you've completed part 1
it doesn't matter, it won't help you solve anything
you'd have to have a megabrain to deduce any meaning from what i sent
I just wrote some horrible code for part 2
my solution is pretty clean, what's left if it works lol
||I stored both the grid indices and the walking directions in the set to detect cycles β οΈ ||
if the map is like 10000 x 10000 large it would have taken eternity
||you can store one of the indices and the direction for each rotation||
Pretty sure that would happen for any code don't think there are much optimization path
||You could only search for the location reached in part 1, the simplest to shortcut||
well I guess use brute force whenever I can and not trying too hard to be a smartass 
||well, that's what I did because I rather think for 1 minutes instead of wait for another 45 mins because I wrote horrible code for part 1 that is slow||
||yeah but I didn't think of a way to detect cycles quickly so I just shoved the directions in||
||Well, For each obstacle, it must have a obstacle in one of the 4 side|| idk if it optimize
Wait no, thats not exactly accurate
||For each obstacle, it must have a obstacle in
#
#
X
In some form
||
Just got on the s Bahn and thereβs a guy doing the advent of code in python lol
Iβm here reading dragon quest manga on my phone instead, havenβt even done day 5 part 2 yet
Day 6 Language roulette is... **bash / fish / zsh / csh / tsch! **
lol
somehow my pt1 code works fine for the example data, but for mine it does not give the right answer π
Welcome to Advent of Code
i copied the coordinates top-right-down-left from the day4, but guess what?! i had them there in another circular order. tried to fix the logic of the code which actually worked for like 20-30 minutes until i decided to print that grid to see how the guard moves π
hi
Your computer appears to be computering
I see some spare cpu
nice
> time bash main.sh
Part 1: redacted
Part 2: redacted
bash main.sh 5123.00s user 26.30s system 1559% cpu 5:30.25 total
5 hours?
yeah today's gonna test people
welp it took me like 8 hours
but I finished day 5 in forth
too bad I couldn't charge my laptop on the plane and it also took me my entire laptop's charge to do so
8 hours for one charge is impressive
it was probably 10
I was using it for a while in the lounge since my flight got delayed
Working my way though aoc using rust :p
congrats
is there a way to load the input directly without downloading it first as a txt?
target_url = "https://adventofcode.com/2024/day/2/input"
data = requests.get(target_url).text
i did this but i get
'Puzzle inputs differ by user. Please log in to get your puzzle input.\n'
as response because the request wasnt logged in but can i do that somehow?
with the relevant cookies or whatever, yes
thanks got it π
<@&831776746206265384>
!warn 692345716273578014 This server is not the place to advertise. Your message has been removed.
:incoming_envelope: :ok_hand: applied warning to @naive mulch.
i hope the next puzzle will be easy as well π
Someone help me please with this error. IM making an discord bot
π
I will kiss your foot 10 times if someone help me π
I may used chatgpt to make the uhhhhhh discord bot but i had this error before but i just reseted my pc bc it wasent working good now i got this erorr even i installed everything u needed

This is a discussion channel for advent of code, advent of code is the website: https://adventofcode.com/2024
huh ok
right thanks
Almost caught up.
#aoc-announcements message
How dare you group csh/tcsh and fish in the same category as bash/zsh!
a.k.a. babby's first dp problem
Why epilepsy π€
Wasn't that the one when they all flashed and eventually synced up?
oh
https://adventofcode.com/2021/day/11
They were octopuses
someone visualized it with physical leds: https://old.reddit.com/r/adventofcode/comments/re000o/2021_day_11_part_2_c_trying_to_do_everything_on/
bit late to AoC lol
well it's only day 6 and its the weekend! plenty of time to catch up
I.... I feel so stupid. I was pretty happy with my Day 6 pt1/pt2 solutions, but they just took forever. I tried to figure out how to optimize my code and was startled at the difference in one tiny change. I had been storing the walls and open spots of the grid in an array. I changed to a set. O. M. G. It didn't occur to me to use sets, but in hindsight it's obvious. Here's the difference in runtime π
With Arrays:
part1 time: 0.349637 secs
part2 time: 402.664583 secs
With Sets:
part1 time: 0.002276
part2 time: 2.162015 secs
you'd need top 20 pretty much every day from now on if you wanna catch up to 1st
I mean catch up on puzzles
can I borrow a couple... actually, can you just gift me the entire computer
(what cpu is that?)
Maybe double that and give it to me, so I give one back to you and we both get one (X
Thought this was a little silly
my initial bash solution sure was something
then I did a slightly more clever solution in C++
~26ms
I wrote it in python to get the logic down and attempted to translate it to haskell since I'm doing a different language every day, I was only able to get the translation to work for the first part though so I "failed" part 2
800-ish GB of RAM btw
you're doing a different language each day, but not the roulette language each day? π
it was randomized
I just wrote them down and generated them all at once
Interesting, yeah nah I had made my own and randomized them before it actually started
whatβs the observation you used
weekend is here, this one might be ramping up the difficulty a bit
<@&518565788744024082> Good morning! Day 7 is ready to be attempted. View it online now at https://adventofcode.com/2024/day/7. Good luck!
29/28
165/83 first top100 this year
im getting this completely wrong
π
but its getting the example problem right
lmao got it
started. part 2 isn't working for me :/
have you considered ||having the concatenation operator have the same precedence as the other operators||
such a breath of fresh air compared to Day 6
More precisely, ||it's left-to-right evaluation, not BODMAS||
Take your pick of acronyms
PEMDAS
got the classic works on the example but not my input. I wonder what stupid thing i'm doing that will take me an hour to realize
does your program think that ||20: 10 10 10|| can be made true or not?
it does
yes it should lol. appreciate it. lets see why that is happening
-# I am the bug whisperer
-# you're welcome
lol now i have the same issue for part 2. example works, input doesn't. woof
Ok
ahhhh i figured out the issue, i'm so dumb it's actually amazing
uummm
I finished Part 2 today really fast haha
My code was modular enough
I know no one really cares about this, but I'm happy to finally reach top 10 :D
congrats!!!
regretting waking up late smh it was easy today
dam which lb is this
i am in the old one sheesh
it might be the language roulette leaderboard?
whichever one you get into with /aoc join i guess
Cam Caswell's
aight
Mine says "Joe Banks"
how do I get a display like this?
go to leaderboard than personal
i see
holy shit i'm slow
don't mind the 3rd one I forgot to do that day
i think this year AoC is really balanced imo
I was concerned: the example in d7 part 2:
||
7290: 6 8 6 15 can be made true using 6 * 8 β 6 * 15.
but 6*86*15 = 7740 tho
||
discord highlighting screws us up once again
use this character ||β||
nvm, read 2 message above and got it
it was ||486*15 and idk why I think concat have higher presedence first||
today is not bad :)
You are not allowed to use that command here. Please use the #aoc-bot-commands, #sir-lancebot-playground, #bot-commands channel(s) instead.
Yes, 100%. you can use anything you want (except Gen AI I think)
Any language is allowed, all libraries are allowed. There's even the occasional problem where you'd want to do part of the problem (or all of it) by hand.
That said, if your primary goal for AoC is to grow as a programmer, then implementing algorithms instead of using a library or built in may help with that (but knowing how to find a pre-written function in a library is also a good programming skill)
Yeah, trying to use AoC as a tool to grow and learn python, I was just curious, but for now attempting the most basic and native code I can
Still relatively new π
guys, a speculation on today's AoC:
(part 1) two possible operators, and if you have 11 numbers, that's 10 positions for operators, so only 2^10 = 1024 cases to check in total
so isn't brute force completely viable?
I'm sure it's gonna get much worse in part 2, but this is just my idea for part 1
I can't think of anything else
I'm guessing it's dp, but I don't understand how to use it here
yep
same bro π’
I used brute force, but in retrospect, there's a possible optimization: ||since you know that f(a,b) >= max(a,b) for both possible functions (assuming no negative inputs), if at one point (e.g. 5 operations out of 7) a number in your list is greater than the target, you know that final result > target, therefore final result != target, and you can stop early.||
wait I just realized it said compute left to right
so then I can try thinking about algorithms
ok i just came up with a recursive algorithm that counts the number of ways you can get the target number
but I don't see how this is different from brute force lol
well actually yeah I can prune some cases with this
amazing! (oh hey, we're in the same leaderboard)
oh hey hedy! long time no see
and yeah haha, you're rank 7 π
maybe not for long... I'm not as comfortable with fennel as I am in python
that lb is for any language right
yeah, I would assume so
is your aoc challenge this year to do it in fennel?
indeed! with emacs too
ooo
in Axedit π?
current idea
||```rust
fn rec(target: f32, nums: &[f32], orig: f32) -> usize {
let len = nums.len();
if len == 1 {
return if nums[0] == target {
1
} else { 0 };
}
let last = nums[len - 1];
rec(
target - last,
nums.iter()
.take(len - 1)
.collect::<Vec<>>()
.as_slice(),
orig
) + rec(
target / last,
nums.iter()
.take(len - 1)
.collect::<Vec<>>()
.as_slice(),
orig
)
}
I'm not at home rn so I can't test it (I'm writing code on my phone π), but I will when I get home and I hope I can improve it
Anyone have a good AOC helper for python?
(more specifically for fetching your personal input and submissions)
||just realized I should use integers, and if the result of the division is decimal I can just prune that part, and also target can never be negative or above the original, so that allows a lot of pruning||
!pypi aoc-lube
||```rust
fn rec(target: i32, nums: &[i32]) -> usize {
let len = nums.len();
if len == 1 {
return if nums[0] == target {
1
} else { 0 };
}
let last = nums[len - 1];
if target % last != 0 {
return 0;
}
let sub = target - last;
if sub < 0 {
return 0;
}
rec(
sub,
nums.iter()
.take(len - 1)
.collect::<Vec<>>()
.as_slice(),
) + rec(
target / last,
nums.iter()
.take(len - 1)
.collect::<Vec<>>()
.as_slice(),
)
}
This is rust?
Yea
It is rust
Hah, no
But maybe I should try solving AOC with it on some day
Im just so busy with my BTech Engineering degree that I've got little time to spare
why 48 || 90 = 7290?
i actually came rn to ask the same question
the operations are evaluated just left to right, no precedence, how did you solve part 1 without this?
ya, i figured it right now xd
Operators are always evaluated left-to-right, not according to precedence rules.
its literally 6 times 8 first which is 48 then it concatenates the 6 so it becomes 486 then it multiply it by 15
true thx, i forgot about that rule, made list of strings then joined them and int xD
fwiw, it would be more efficient to take sub-slices instead of building a new vec with the same items: ```rs
&nums[..nums.len()-1]
ohh I didn't even know rust had subslices π
a slice is essentially a pointer to the first item and the length, so it's pretty straightforward to create sub-slices which point to smaller regions of the same data
yeah, dumb of me to assume
everytime I use recursion I have to spend at least 30 minutes figuring out how recursion works 
You'll get used to it
what, why don't you just use it? isn't it kinda ready for that now?
Bugs
Nasty ones
Im already battling my time against Indian Engineering
Hmmm...
currently doing AoC day 3 part 1...
I have a slight feeling I know what's going to come next...
you would be ||wrong, probably||
not ||nesting||?
day 3 is babby problems, writing any non-trivial parser would be way out of scope
I mean, I did write a parser, but that's more because I didn't want to try to get into doing string manipulation in smalltalk π₯΄
no wait
elm
in any case
wtf so I wrote my 30 line-or-so ||parse_mul(file)|| instruction for nothing π
π
I just imported the elm regex lib 
@compact wasp congrats on 1st
LLM cheaters were here from day one 
Last I checked the person that committed their cheating code to Github was still on the top of day one
there's also the guy that's currently 8th on the global leaderboards that has a repo to automatically send the puzzle text and stuff to Claude to solve it
shit i still havent started AoC
high five bro
i started at 10:13 PM π
also lmao i was using i32s and this number made it overflow
π
please don't spoil ||part 2|| in this channel.
please ask for hints in #aoc-solution-hints
congrats
I'm not asking for a hint, I'm asking for a particular python function
uh im pretty sure itertools has smth for that
Yeah, me too, I was sure it ws combinations_with_replacement, but that's only generating 4 options for n=3 when it should be 8
doesnt ||itertools.permutations|| work when you pass the second parameter?
Hmm no it's giving me empty list, maybe I'm using the second parameter wrong? (I'd show my code but I don't want to spoil and I don't know how to do spoiler formatting on discord XD)
check the docs maybe
to spoiler, do ||your message here||
and code blocks just use markdown syntax
Ah, perfect, thanks
I'm just trying it in a shell with ||[p for p in permutations(["A","B"], 3)|| but it just gives me ||[]||
(python 3.13.1 btw)
hmm
unrelated but you can call list(...) on the iterator instead of using a list comprehension which returns every element
yeah, I know, bad habit. too much ruby :p
ok what lmao
hmm
maybe i've misunderstood this function
but trust me there's no way itertools doesnt have a function for this
Yeah, I'm thinking the same thing. I'm like "no way this isn't a builtin in python"
Maybe r has to be < len(iterable) for permutations to work?
ok turns out you were right about ||combinations_with_replacement||
wait no what's happening here
this is not right
Oh yup there it is: https://docs.python.org/3/library/itertools.html#itertools.permutations ( if r > n: return)
ok i think i've found teh function
Yeah, it's missing like half of them. At first i thought it might be "oh just reverse the order to get the other half" but it's missing some mixed combinations too
enlighten me, o wise one of the interwebs
this function looks right
YES finally jeez this has been stumping me for like an hour thank you!
btw for this problem, better than brute forcing is ||dynamic programming||
Oh for sure, I take a very slow and steady approach - I build up a (relatively) easy-to-understand (but generally about as un-optimized as you can get) solution for the test input first, so I have something to test a more clever one against later.
NOOOOOO
I've implemented a very basic timer, and so far it is not looking good ```
day_1 part_1: 181.5Β΅s
day_1 part_2: 204.6Β΅s
day_2 part_1: 167.7Β΅s
day_2 part_2: 473.3Β΅s
day_3 part_1: 18.1Β΅s
day_3 part_2: 21Β΅s
day_4 part_1: 205.3Β΅s
day_4 part_2: 118.7Β΅s
day_5 part_1: 4.5244ms
day_5 part_2: 102.9178ms
day_6 part_1: 170.1Β΅s
day_6 part_2: 108.3285ms
day_7 part_1: 7.1875ms
day_7 part_2: 191.6609ms
Total time taken: 416.1794ms
And that's in release mode
you could probably improve on this a bunch pretty easily 
my pascal implementation is <100ms without doing anything really clever
finally done π
the problem was an edge case in the math i was using, and this case never showed up in the test input
i'm pretty sure π
lol... my solution for pt2 from last night ran in 1.44s and felt a bit brute-forcey (though I don't know how I would make it not feel that way), so just now I thought, hey, let's see if ChatGPT can get it running faster. I fed it my solution and told it to optimize it. Now it runs 4x longer. ππ
aoc_lube raises ValueError: Request failed. if i do RAW = aoc_lube.fetch(year=2024, day=7) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
My code for day 7 part 1 is failing for the real data but passing the test data, and I can't find the issue... it's a pretty simple impelemtation too. Anyone fancy taking a look? Don't want to share here for spoilers, but could do that too
Oh sweet, thanks hsp
do yall benchmark your solutions? i wonder if Rust discord is the only one like that
im not surprised at all
that the rust guys would do that
i feel dirty. I got part 2 using the exact same brute force algorithm as part 1, just adding in the extra operation. it didn't even take a long time to run: < 2 minutes
same. except my part 2 took ~6 minutes. π¬
only way to git gud is to be shit for a long time
maybe running it on my big gaming rig is cheating π
My pt2 wasn't too bad. It took 1.44s. I used a recursive method, with early exit if it went out of bounds.
the longer aoc goes the more of my code will likely become brute forcing
... Well I ran it on my work laptop expecting it to be slower... It was almost twice as fast XD. so gaming computer: not cheating
i wonder if i should release my utils when aoc ends
You could release them now
i dont know if i can be bothered to start AoC now
Man every year I always get a few days into AoC then give up when I hit a complete pain in the ass problem
Cherry on the cake this year was not getting day 6 after hours of trying to debug it, so I decided to revisit day 2 part 2 to see if I could get it working... then realising that the code was completely incorrect but by a pure fluke, I got the right answer to part 1
you can brute force day 6 pretty quickly, if you just do the most obvious code you can think of
As in the code runs pretty quickly
not the implementation itself
I tried that, but my code got too complex to the point that I couldn't debug it
<@&518565788744024082> Good morning! Day 8 is ready to be attempted. View it online now at https://adventofcode.com/2024/day/8. Good luck!
k
i aint participating anyway
yeah, on the website if you click the year it'll let you select previous ones
thanks!
no comment
i'm not gonna get into tmi territory here
but both parts were trivialized by my vector utils thing
come on bruh
2317/1714 brain slow
real
?/? in a car
real
1982/1378 . My best score this year so far (apart from day2, but that's skewed because so many people had connection issues including me)
Lost a minute on part2 because I didn't notice ||antennas would be antipodes|| on first reading.
these numbers are your p1/p2 ranks, right?
sadly yes
far behind everyone else
but leagues better than last year
does anyone else think this year's challenges seem to be easier than the last?
I think that, yeah. I've done the first 9 and first 11 days of 2019 and 2023, and they all felt more tricky
3420/2816 my average is slowly improving
calm before the storm π
1526/1533
my best yet
definitely π
Please anything but the dijkstra
definitely easier than last year
Yes, but last year's first week was also already leveled-up compared to other years.
</aoc join:1312458389388787853> should give you instructions
ive done that i got the code but i dont think im in the right leaderboard?
the python discord has multiple leaderboards, the sum of those can be found with &aoc lb
aoc only supports a certain number of people per leaderboard
There are a bunch of leaderboards. You have to asscociate your Discord name with your AoC name. You won't see your name after joining for like half an hour.
what's the average runtime of today's puzzle?
about instant
about?
0.08s Python
part 2 runs in .0047 seconds using python
part 1 is faster. π
0.001s 
I joined the leaderboard through the bot link a few hours ago, and it's detecting that i solved today, but when i made a leaderboard request the bot didn't return the top row with me and my ranking, does that take longer to connect my discord to my AOC profile?
'You have to asscociate your Discord name with your AoC name.' - is this an extra step?
0.0007s
I don't think it's required, but if you do it, then when you ask for the leaderboard, it also tells you where you're at on the leaderboard at the top, before it starts listing the top 10. Here's an example: #aoc-bot-commands message
Yeah, that's what i did, but it doesn't show what my score is at the top. You can see I'm the last person to use the bot command
&aoc link
awesome thanks
print("Hello guys")
Error
Hey Guys! I need some help in AOC Day 4 Problem 2, My code works for the sample, but it doesn't seem to work on the actual data. the answer is apparently "too high", I am pretty new to programming to i would love some help π
please ask in #aoc-solution-hints and/or https://discord.com/channels/267624335836053506/1313732973274599464
oh god, the definition of antinodes today makes me a bit sad
that's not how that works in practice π₯΄
daily life pro tip: you can declare an enum in one line like this
option1, option2, option3, [...], optionN = range(N)
as in
identifier, number, symbol, eof = range(4)
being in line is not a requirement at all
personally I would use an enum
depends on what you want/need
and how long you want to spend on the declaration
actually it's worse, it also contradicts itself
any point that is perfectly in line with two antennas of the same frequency - but only when one of the antennas is twice as far away as the other
contradicts
This means that for any pair of antennas with the same frequency, there are two antinodes, one on either side of them.
that does not follow from that definition
e.g.
a...#.a
```or
a......
..#....
.......
......a
so a bunch of configuration should have 4 antipodes
e.g.
...#..a##a..#...
Hi guys, i've created a tool which roast your resume. check it out: https://resume-roast-ukhi.onrender.com/
It's a fun side project
I'm not storing resume so it's 100% safe
it's completely off-topic for this channel
you could try one of the off-topic/general channels if you really want to
lmao the standing wave context right
right
How would y'all rank the AOC challenge difficulties so far? To me, this is how hard I found each personally (in descending order):
4, 6, 8, 5, 2, 3, 7, 1
Oh, I used regex for day 3
day 6 hardest
day 5
day 4
day 8
day 7
day 2
day 1
day 3 easiest
i think? maybe
def biased on me getting stuck for no reason
1 3 2 7 5 8 6 4 from easiest to hardest
(hardest to easiest) 5 > 2 > 6 > 4 > 7 > 8 > 3 > 1
Easiest 1, 3, 2, 8, 4, 5, 7, 6, hardest
π
Interesting to see how peopleβs perceptions of easiest to hardest are
you found day 5 harder than day 4? interesting
I would agree with that for me
well day 4 is just a thing that happenes every single aoc
feels like i've done this a bunch of times already so it wasn't that hard
i think it might be influenced based on the challenge people are trying too
like, some people didnt use regex for day 3
and some people might be using a new programming language
fair
i feel like gamedev helped me with day 6
i also feel like after finishing aoc ill be warmed up for my next game
i want to try pyglet
glgl!
make aoc visualizations in pyglet
you found day 7 harder than day 6 and day 4?
For me if I did day 7 naively I would probably have found it quite easily
oh, I should flip that
rich.print π
tbh my rankings are kinda more "how hard did i make the problem for myself"
But I spent more time than I needed to on 7 thinking up a more optimised solution
im just trying to do it as fast as possible haha
since all the days have been pretty easy so far, so i'm kinda just ranking them on "how much work do i have to do"
day 4 required either minimal conceptual work but more coding work, or more conceptual work but minimal coding work, which is why i ranked it as hardest
smh
The actual hardest day for me was day 2 as I did that in Smalltalk
salt die has a monopoly on visualizations he needs competitors
the actual hardest day for me is day 5 because i did that in forth
salt die do be having really good visualizations
cant compete with allat
id be needing to give my 130%
for me i found day 8 hardest to conceptualize
but i think thats just because i was too lazy to read it properly, i kind of got what to do based on the example and input data so far
god, it took me 4 hours, i finally did it
lots of stuff i misunderstood
Day 8 was very easy for me once I looked at the diagram instead of the words
If I only had to rely on the words I would still be here having not yet solved P1
this was me today (https://www.reddit.com/r/adventofcode/comments/1h9bmsm/2024_aoc_day_8_what_does_this_even_mean/ )
i got help in #aoc-solution-hints to understand day 8
No, it was the fifth day ;)
missed opportunity not doing forth fourth, yeah
easiest 1, 3, 8, 2, 5, 7, 6, 4 hardest
I was so confident in my method for 4 and it never got the right answer so it took me 2 rewrites to understand
now make it with Pillow
Ngl reading the text has, for the most part, done nothing but confuse me
so, for day 8 part 2, ||is there an antinode on every antenna, if there are 2 or more antennae of that type||?
||I just added the antennas to the count and it was valid lol|| maybe it's just how mine was set up
||I think it's supposed to be that every antenna is also an antinode for its partner node or sth||
well reading the text (which I know is a mistake, but...), ||every antenna is probably on a line between itself and another antenna||
Can I join in from here or does it have context related to previous ones?
you can join from day 8 just fine
I'll start on this in a while. What kind of stuff is this? Problem Solving? A puzzle?
Me not reading the question and:
Antinode isn't on the antenna
Waste 20mins
Me:
Should have read the question
Because it never have and could be demonstrated on the diagram
yeah, pretty much
maybe im weird, but that absolutely compelled me to reveal each and every one of those lol
Hahahaha
||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||||pop||||pop||||pop||||pop||
||pop||||pop||||pop||||pop||||pop||||pop||||pop||||pop||
||pop||||pop||||pop||||you||||los||||tth||||ega||||me.||
||pop||||pop||||pop||||pop||||pop||||pop||||pop||||pop||
does anyone know how private leaderboards work? how is it possible that I rank higher (on the private one) than someone on the global leaderboard, where i am no where even close to the global lb
ranks are per-lb afaik
they have a better time on every single question except for 1
it counts number of people you beat, so it could be possible if you beat them by 10 in the 1, and they only beat you by 1 7 times.
gotcha
you absolute monster i love you
π
why do I have two slots in the &aoc lb
should i do adventofcode as a beginner?
Yes!
The first days are perfectly geared to beginners
alright, thanks!
tbh im getting information overloaded, at the same time i have no idea what path i wanna go down
Well, Advent of Code is just for Xmas :)
ahhh
Itβs a set of 50 small puzzles
2 every day from 1st to 25th Xmas
Plus a back catalogue of previous years
start at day 1
Nah - jump in and have a go!
it's never too late, unless you want to compete for the leaderboard and stuff
I'm having fun doing previous years' problems once I'm done with each day's 2024 problem
sounds good
Have a go at Day 1 and feel free to let us know how itβs going :)
you can ask in #aoc-solution-hints if you're stuck
will do, thanks!
alright
thank you
yoo
guys
Cna anybody
tell me how to earn money using python
as a teen
Ik a lot
og python
made a lot of opencv projects
pls I need help
I got paypal
Quick question, is it fine if i know how to solve something but not certainly know the syntax of it so i search? i mean i guess it helps me learn i js feel non accomplishment when i do something like this lol
@sterile talon consider asking in #career-advice , this isn't on-topic for this channel
ohh sorry mb
yeah, perfectly fine
one's skill in programming is about reasoning and creativity, not memorization. I look up stuff all the time.
You are doing day 1 of 2024 yes?

Yeah
Feel free to post in #aoc-solution-hints if you need any pointers
isnt day 1 the easiest of them all, i feel like in that case i should just work more on my programming skills before i get into it, or is that not the case
Not really - you can use this to improve your programming skills
You donβt need to know more than the basics to do day 1, really
oh
the problems do get harder, and day 1 is supposed to be the easiest
but yeah, this is a great opportunity to build your skills. you're faced with something you can't solve, so try more.
Thatβs probably not the best if you want to actually learn
that's how we may go extinct indeed
yh
real
(If you want to use AI to help you solve puzzles, I can't really stop you, but I feel like it's harder to get better at programming if you ask an AI to do the programming for you.)
tru
i mean ofc i wont, my skidding days are over

anyways ill go try and solve the first day
thanks for the help
if you can't do day 1 at all, my suggestion is to just not think of GPT as even an option. having it as a fallback in your mind tempts you to not build any skills or actually develop your thinking.
How much knowledge of Python features do you know so far, out of interest?
i have recently finished this 12h course that goes over basically all the base stuff, some stuff i have forgotten though.
Like maps
If youβve done a basic course then you are ready for this
You should have probably 80% of the knowledge you need and then 20% you probably need to Google for
But the only way to actually truly get familiar with coding is to start coding
Hereβs not the place to discuss solutions
oh my bad
nice
relationship-wise? that's a bit of a personal question, ngl
/s
nope, sorry, I am not available for purchase at no cost
I cannot be purchased with a one-time payment
Hahaha
Hey @naive wharf would you mind helping me to create a magnifier on python ?
This will be my first software/app that I will try to create
Please
Give me a hand
this is the advent of code channel
Magnifier?
depends on the OS, on Windows with tkinter and PIL probably very doable, but again, this is not a help channel (at least definitely not for that kind of stuff), so you should go and either ask in #python-discussion or #1035199133436354600, also make sure to read #βο½how-to-get-help
I know including your personal puzzle input within repo's is discouraged, but does that also apply to the example inputs given in each day's problem statement?
Yes, thatβs part of the puzzle text
Can I copy/redistribute part of Advent of Code? Please don't. Advent of Code is free to use, not free to copy. If you're posting a code repository somewhere, please don't include parts of Advent of Code like the puzzle text or your inputs. If you're making a website, please don't make it look like Advent of Code or name it something similar
Right, I saw that, I guess I just wasn't sure if the example inputs counted as part of the puzzle text.
Thanks!
||
