#Advent of Code 2024

129 messages ยท Page 1 of 1 (latest)

gritty current
#

Im somehow stuck on the result and im pretty sure im very close. But after sorting all i do i check

|| i made a list for all differences so what number it get from the example what is 7 - 6 etc and add these to a list. And then i foreach the list and set a string to safe as default and if the number is -gt 2 i change the string to unsafe and break there to go on. And then if the list is safe in the end i append that number to a variable. So in the example i get 2 but in the real data i get wrong number for some reason. I see that I dont care about 0 but i tried that too and still got wrong answer. ||

gritty current
#

Managed it! Hope rest of you are having fun with AoC. Imo day 1 was very easy and day 2 was horrible

hollow plume
rancid willow
#

Day 2 Part 1: I've been deceived by ||silly string/int conversions! Apparently "9" is greater than "11" but 9 is greater than 11. Not sure why I thought "9" would take up less bytes than "11"||

rancid willow
#

Right done it... Lost about half an hour troubleshooting a non-existent issue... Turns out I had only copied 999 out of 1,000 rows from the input data so was always a number off. ๐Ÿ˜… ๐Ÿ˜ฉ ๐Ÿ˜ญ

pine cypress
rancid willow
#

Yes Chris! Always enjoy comparing yours to see how I can improve

rancid willow
#

Guys I'm beginning to think I'm already out on Day 2 Part 2. This one has so many secret layers of complexity

pine cypress
jagged prism
#

Yea day2 part2โ€ฆ i thought i had som nifty stuff going on but gonna need to rewrite that. this day was more pleasant ๐Ÿ™‚

pine cypress
#

heh and I would say near identical to @jagged prism 's work ๐Ÿ˜„

jagged prism
#

@sullen summit time to get coding ๐Ÿ™‚

rancid willow
#

Does anyone have any tips for Day 2 Part 2? I've created my own set of test data and it returns the expected results but I cannot get the right result on the real data.

I've checked the input data and I've got all 1000 rows this time.

I've gone as far as adding logging for everything and I just can't see what's going wrong

#

I think it may have just twigged... || I determine if it's an asc/desc pattern based on the first two values so if we remove a value that could change everything ||

#

Oh my god that took me 16 submissions. By the end it was giving me a 15 minute waits

frosty venture
pine cypress
jagged prism
#

should you add the invitecode to AoC in the top message? @gritty current @pine cypress

gritty current
#

Ah its specific for each year

#

Can you create on and share to me so i can update msg @jagged prism ? ๐Ÿ™‚

#

Im stupid, code is in the top message now ๐Ÿ™‚

hollow plume
rancid willow
hollow plume
rancid willow
#

Maybe not the best way but I spent way too long on part 2

hollow plume
#

That's sort of my point - having a heuristic that was easy to implement made repeated testing in part 2 much more straight forward ๐Ÿ™‚

rancid willow
#

I thought mine was easy to implement. ๐Ÿฅฒ Just didn't expect that very small niche consideration! All good fun ๐Ÿ˜„

jagged prism
# gritty current I can add it

No not for each year but for the specific leaderboard and i think chris is the leader of it so he has it, or if you venture to last years channel and find it there

gritty current
#

Yeah i added it

rancid willow
#

Oh so this is where you're all hanging out!

pine cypress
gritty current
#

Todays part2 ๐Ÿ˜ณ

pine cypress
#

I'm resisting the temptation to go back and simplify mine now. But it did make part 2 a pretty simple modification. Lucky that.

gritty current
#

Yeah, I can read yours haha. Mine is spagetti

uncut isle
pine cypress
#

faster than mine ๐Ÿ˜‰

jagged prism
#

Aww i vomit seeing what i did comparing to yours @uncut isle ๐Ÿ˜„

uncut isle
jagged prism
#

i thought about the kind of solution but just started on a set track and just did it ๐Ÿ™‚

jagged prism
rancid willow
pine cypress
jagged prism
uncut isle
jagged prism
pine cypress
jagged prism
#

yea, i kinda bruteforced it but im getting someone else result โ€ฆ but i have a theory of how i can solve it

#

part2 that is

pine cypress
#

yeah my pt2 is also a brute force attack.

It's so, so slow. I just left it going, took a laughable 110 seconds.

I figured I could just ||resume walking the route from a specific point||, even though I think I'm missing a faster way still. But I'll have to do more work to it.

I have the right answer... my motivation to make it better has vanished ๐Ÿ˜„

For posterity:

||https://github.com/indented-automation/AoC/tree/master/2024/06||

pine cypress
jagged prism
#

i still can figure out why my day6 pt2 doesnt work :/

#

i've compared it your result chris and it just off by a few numbers. and ill leave it to dwell on it

#

and i got so stuck doing todays || permutations|| that i went in another directions and i can see that yours was very clever ๐Ÿ™‚

pine cypress
#

yours is super-interesting if I don't dot-source it ๐Ÿ˜„

#
   6 |      [uint64]$sum,[uint64[]]$operators = $_ -split ': ' -split '\s'
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Cannot overwrite variable sum because the variable has been optimized. Try using the New-Variable or
     | Set-Variable cmdlet (without any aliases), or dot-source the command that you are using to set the variable.
``` oops ๐Ÿ˜„
jagged prism
#

hmm what? ๐Ÿ™‚

pine cypress
#

s'what it does if I just .\yourscript.ps1 instead of . .\yourscript.ps1.

#

it really doesn't like re-using that parameter variable ๐Ÿ™‚

jagged prism
#

yea i got that, ahh i might have been lazy with some rewrites ๐Ÿ™‚

#

like now it works im happy ๐Ÿ˜‚

jagged prism
jagged prism
#

@pine cypress is it some special consideration on day8 pt1? || im i correct interpeting the text, a signal can overlap but only counted once, and if it is out of bound its not, and it can be over an antenna but still only counted once? ||

pine cypress
#

Correct on all counts

jagged prism
#

im so dumb

#

i need to initiate the hashtable with casesensitive

pine cypress
#

Haha yes, i noticed that early whrn it was ||mixing case|| in the sample

jagged prism
#

yea gaahhhh ๐Ÿ˜‚

pine cypress
jagged prism
#

nice || when you can remove the visited table to solve pt2 ||

pine cypress
#

heh same change for yours as mine ๐Ÿ˜„

jagged prism
#

I have no clue why i go with the || recursion || i thought about building a || graph || and just do a || DFS search || but i tend to go back to my defaults, i like you || class || approach more

pine cypress
jagged prism
#

ahh yea thats true

jagged prism
#

im so slow trying to find that || stone lifecycle pattern ||

pine cypress
#

day 12... slowly slowly

jagged prism
#

yea not started that yet work and life takes time ๐Ÿคฃ But part1 was fairly quick. But i think i added to much complexity

pine cypress
#

yeah, I have work to do. A bit of picking away perhaps

#

heh the right answer for pt 1. That's something of a miracle

jagged prism
#

nice

jagged prism
#

dou you have any spoilers/hints for pt2 day11? ๐Ÿ™‚

pine cypress
#

||group them||

jagged prism
#

i can see that || after iteration 22 they have all the the same unique number ||

#

ill try that

pine cypress
pine cypress
#

Day 13 part 1 was fine, but part 2 needed me to seek help. Needs ||linear algebra|| to solve ||multiple simultaneous equations||. Not a thing I've had to do since school.

Poked around reddit a bit and it said ||Cramer's Rule|| was needed and shared the formula. Plumbed that in and:

||https://github.com/indented-automation/AoC/tree/master/2024/13||

#

Day 14's first part was fine, although I had a typo for a while that made finishing part 1 somewhat difficult until I noticed it.

Part 2 is insane. I have no reproducible solution for it, I 've just ||sat here watching my grid change on the screen|| and behold, I did actually ||see a Christmas tree|| and I know where that happens for my input.

Spoilers for anyone else I'd suggest "probably" somewhere between ||6000 and 8000 seconds||.

||https://github.com/indented-automation/AoC/tree/master/2024/14||

jagged prism
#

part2 was insane yea

#

chris i see that your rendering is hell of a lot quicker then write-host?

#

ive seen that you use [console]

pine cypress
#

yeah, becase Write-Host will want to redraw rather a lot. Whereas if I move the cursor to a place on the screen and write just one character it's much faster

jagged prism
#

yea but never used that but i think it will improve my experieance since now im watching an old needleprinter print stuff hehe

pine cypress
#

there's a lot of grid puzzles this year or I wouldn't have bothered so much

jagged prism
#

yea, im envious of those whu visualize in python etc and then in watching my console rendering like and ol fart hehe

jagged prism
#

for part2 i tried so many things. And i tried to see if there was || no robot overlap so max 1 robot at any given position and voila || but it also seems that you could use le ol || chinese reminder theorem like the buss schedule but im lost there ||

pine cypress
pine cypress
jagged prism
pine cypress
#

haha nice, I couldn't figure out a way. I had no clue what the christmas tree looked like to do anything programmed. Then by the time I did know what it looked like I could not be bothered to track backwards ๐Ÿ˜„

jagged prism
#

chris, regarding pt2 of day12. i know o struggled with last years counting outside of the pipes. pt1 was super easy but i cannot get pt2 to compute from thought into code. its dead easy to solve by hand. Im doing BFS for the pt1 . And ive tried a few solutions to pt2 but i fail on some edge cases. i guess ill just have to continue, i skipped this first but went back. But uou know its grinding in my head why i cannot solve it. Ive read some tips but i already know in my head how to solve it.

Did you just walk the permieter bodes and counted directions? Ive tried to just count the corners but im stuck in one way of thinking

pine cypress
jagged prism
pine cypress
#

Depends a bit how you discovered the shapes. I tweaked part 1 so it would show both the edge and the direction of the edge.

Then pt 2 was just counting edges between min and max x and y of the shape.

jagged prism
#

allright, i just did a bfs with no consideration and just counted all not in the current plot for the pt1

jagged prism
jagged prism
#

i figured it out with a small sample from reddit

#

it was two path that converge on a same "cluster" that made it wrong that was a case in my input

#

so you where lucky ๐Ÿ˜‰

pine cypress
#

ouch :).

jagged prism
#

fustrating to say the least

pine cypress
#

yeah edge cases not demonstrated by the examples are hard

jagged prism
#
##########
#.......E#
#.##.#####
#..#.....#
##.#####.#
#S.......#
##########
#

this was an edgecase where the top 3-way part is visited at the same time but depending of the queue it will take the wrong path, so i needed to release the visited from cluster nodes to take into consideration that two paths joined there at the same time "kinda"

pine cypress
#

I thought I had that kind of case in my code tbh, but I fiddled with it so much...

jagged prism
#

yea my code looks like mubojumbo now with all i've tried. Not nearly as gracious as your classes looks like ๐Ÿ™‚

#

Thats a part I really want to improve on