#advent-of-code

1 messages Ā· Page 32 of 1

vast jetty
#

fucking amazing

#

ai is so NOT taking over anyone's job

bright spindle
#

Which model is that?

vast jetty
#

yeah apparently salt die has a range library

vast jetty
#

alright sure the good ones are pretty good

#

but this is such a stupid thing to say that i cant

#

MAJOR LOGIC BUG

bright spindle
lime fulcrum
#

when did we have range splitting on another range in 2024 or 2023?

lime fulcrum
#

ok found it. it was 2023 day 5 part 2

grand compass
#

I keep getting pings from here for no reason bruh

lone nexus
#

WHO PINGED ME

potent jacinth
#

A nerd.

hollow wharf
#

I fell as sleep

#

i had a headache

#

now its 5 in the morning

#

time to do it

potent jacinth
#

Are you in the U.S. and A.?

hollow wharf
#

A.?

potent jacinth
#

Yas.

bright spindle
#

The United States and America?

potent jacinth
#

Precisely.

hollow wharf
#

Canada

potent jacinth
bright spindle
#

The NUSbA

hollow wharf
#

yeha

hollow wharf
#

first time getting one of these

#

tf happened here

magic oxide
#

not the $ before variable names...

hollow wharf
#

OKAY

shy tulip
#

I just froze my computer and had to hard reset it because i tried a naive solution to part 1 lol

hollow wharf
#

oh

#

lmao

#

love the speeds

shy tulip
#

I don't think I can even get an empty python file to run that fast

#

||```haskell
import Data.List (intersect)

parseRange :: [Char] -> [Int]
parseRange range =
let start = read $ takeWhile (/= '-') range
end = read $ tail $ dropWhile (/= '-') range
in [start .. end]

part1 :: [Int] -> [Int] -> Int
part1 ranges ingredients = length (ingredients intersect ranges)

main :: IO ()
main = do
ls <- lines <$> readFile "day5/input.txt"
let ranges = concatMap parseRange $ takeWhile (/= "") ls
let ingredients = map read $ tail $ dropWhile (/= "") ls
print $ part1 ranges ingredients```||
so simple and elegant, but absolutly kills the pc lol, it tries to load all ranges into memory

hollow wharf
#

got it

hollow wharf
#

šŸ’€

shy tulip
hollow wharf
#

haha!

cyan sleet
tender swallow
tender swallow
hollow wharf
#

lmaooo

tender swallow
#

it makes sense
||the number of ranges isn't really very large at all, it's just that their span is huge||

magic oxide
#

gonna do it later

cyan sleet
#

last 3 days have been valuable

#

rubies, crystals, perls

hollow wharf
vast jetty
#

Nice

#

How long did they take

hollow wharf
#

25+ ish mins

vast jetty
#

Pretty gooddd

#

I took like 90 mins

#

Maybe 2 hours even

hollow wharf
#

was trivial as hell

vast jetty
#

For part 1

hollow wharf
#

lmao

vast jetty
#

I’m sorry binary search?

hollow wharf
#

thats what i used

#

for part 1

vast jetty
#

how

#

What

hollow wharf
#

i got mine there

#

check it out

bright spindle
#

Oh, wait

#

wrong channel

dense osprey
#

is changing the input such that reading it is easier considered cheating?

hollow wharf
#

u can do anything

#

with the input lmao

dense osprey
#

oh ok

#

i always tried avoiding it to make my program only use the "vanilla" input

bright spindle
#

Ah, ok

hollow wharf
#

part 2 was even more trivial

vast jetty
#

sure

bright spindle
#

But you should spoiler your solution strategies in this channel

hollow wharf
#

yeah thats why i been deleting msgs

#

real quick let me do it

vast jetty
#

There are so many days where it’s literally soo easy to just

bright spindle
#

A word like ||binary search|| is a huge clue

vast jetty
#

like a bunch of problems in 2022

hollow wharf
#

which days were even those oh

#

2022

#

lmao

vast jetty
#

Most of the regex problems we have

#

There was one with some weird ass format where in there’s the info

hollow wharf
#

true

vast jetty
#

I don’t quite remember what it was

bright spindle
vast jetty
#

But yeah

#

Personally I’ve never wanted to find replace since it feels against the spirit of the puzzle to ME

hollow wharf
#

also I think we are entering this algorithmic type problems now I can def see some recursive solutions coming up

vast jetty
#

That’s not to say it’s wrong tho

hollow wharf
#

in following days

vast jetty
#

There was this problem in

#

Hm

#

Yeah it was 2022 again I think

#

The file system one

bright spindle
#

I don't think there are any canonical solutions

vast jetty
#

I saw solutions wherein people copied the input into their project manager

#

And it made the file system

#

Fair game

#

or 23 day 4(?)

#

The quadratic equation one

#

Wherein most people’s solution was pen and paper

#

Including mine

vast jetty
#

We have the weekend coming up

#

I’m anticipating path finding

hollow wharf
#

path finding?

#

graphs?

vast jetty
#

Or some other shit with BFS/DFS solutions

bright spindle
#

Jokes on the AoC puzzle guy, I have even less time for AoC on the weekend...

vast jetty
hollow wharf
vast jetty
#

Last year day 10 was the first path finding one I thin

#

I remember cuz I tried to write a BFS/DFS solution on my one

#

Couldn’t

#

Then gave up

#

And on a later day wrote djikstra’s

hollow wharf
#

shit

vast jetty
hollow wharf
#

I better get myself together and get in practice for it already I really wanna do on same day

vast jetty
#

Cuz I had to write djikstra’s for another day

#

Day 12 or smth

#

just copied code

#

Then day 19 was also pathfidnong

#

I couldn’t do p2 tho

#

Also one of these days had smth I wrote a flood fill for

#

16 or smth

vast jetty
hollow wharf
#

this also been smth

#

i been looking forward to each day

#

This full course provides a complete introduction to Graph Theory algorithms in computer science. Knowledge of how to create and design excellent algorithms is an essential skill required in becoming a great programmer.

You will learn how many important algorithms work. The algorithms are accompanied by working source code in Java to solidify y...

ā–¶ Play video
#

Learn and master the most common data structures in this full course from Google engineer William Fiset. This course teaches data structures to beginners using high quality animations to represent the data structures visually.

You will learn how to code various data structures together with simple to follow step-by-step instructions. Every data...

ā–¶ Play video
#

this is what i plan on doing

#

rn

#

after this walk

vast jetty
#

DSA is low-key pointless

#

I mean it’s nice to know

#

But kind of pointless for AoC

hollow wharf
#

i mean we been using them

vast jetty
#

Who cares that what you’re implementing is a heap

#

What you care is that you’re appending shit to a list and taking list[-1]

#

If anything look up common algorithms ig

bright spindle
vast jetty
#

Or honestly the best thing is just do more years

hollow wharf
#

nah i wanna learn like niche graph algorithms

#

just in case

hollow wharf
vast jetty
bright spindle
#

I think at least in some cases there are DSA techniques that fit AoC problems well

bright spindle
vast jetty
#

As long as you can implement stuff

bright spindle
#

But sometimes you can make fast solutions with DSA

hollow wharf
#

yesss

vast jetty
#

Who cares if your data structure is a heap

#

After all in python you’re seeing that as a list anyway

#

Unless you use fancy data structures

hollow summit
#

if only i had knew day 3 part 2's solution was a ||"monotonic decreasing stack"|| i wouldve probably recognized it and solved it oneshot

vast jetty
#

But I think that’s what I wrote

#

See what I mean?

hollow summit
#

exactly

vast jetty
#

also it’s funer like this

hollow summit
#

if you knew it beforehand you wouldve recognized it

hollow wharf
#

monotonic in a sense that its either keep on increasing or decreasing

vast jetty
#

That’s what I meant

hollow summit
vast jetty
#

At the same time itd be better if you just saw some common algorithms people use

#

Or common things that you might not know about

#

Like people don’t know regex

#

Or fun language features that can make life ridiculously easy

#

Think itertools

#

Think cache decorator

tender swallow
hollow wharf
#

greedy was the first thing i did

#

as soon i saw it

vast jetty
dense osprey
#

||did anyone else also use binary search for part 1 and therefore had to make the intervals disjoint (which makes part 2 trivial)?||

vast jetty
#

I think

#

Strictly non increasing or non decreasing

hollow wharf
vast jetty
#

I might be wrong tho

hollow wharf
#

making part 2 super trivial

#

lmaoooo

dense osprey
tender swallow
#

monotonic can refer to either strictly increasing or strictly decreasing
the specific direction isn't important, the point is that you stick to one

hollow wharf
#

yeah

hollow summit
#

not what it is

vast jetty
#

My point is that you don’t need data strucure knowledge to write it yourself

dense osprey
#

||I was too lazy to make the intervals disjoint at first but that would have made the binary search so much more tedious and now Im glad I made them disjoint||

hollow summit
#

but to say DSA is pointless is just wrong

hollow wharf
#

i mean we use data structures all the times without knowing it, but would it be much better if we knew what we are using? yes

#

we can make better comments

dense osprey
#

i love dsa

vast jetty
#

It takes a while to learn basics anyway

hollow wharf
#

isn't algorithms and optimization like the core of CS?

#

there is nothing else in it

tender swallow
vast jetty
#

Yes!

#

I def recommend solving past year problems and stuff

#

You always always learn smth

dense osprey
low condor
#

I did some of 2015 this year

vast jetty
#

Yesterday I learnt that convolve is a thing

#

that’s cool

low condor
#

Was a very different year

vast jetty
#

Yeah

#

Idk about fun tho

#

You can do leetcode if you hate your soul

hollow wharf
#

i don't mind going through long videos lmao also im gonna get some books on it as well

#

i will check local library

#

and online

#

I need to learn the best

vast jetty
#

Also Gary def learn regex

hollow wharf
#

True

vast jetty
#

I bet you we’ll have a reflex problem real soon

#

Regex*

dense osprey
vast jetty
#

It’s so handy

dense osprey
#

no

vast jetty
#

Promise

#

It’s so easy I’ve learnt it like 2,000 times

vast jetty
#

It’s like 5 lines of code

bright spindle
#

Using DSA for AoC is useful in the sense that it helps you become more familiar with DSA techniques and make those techniques more accessible when you might need them in some other project.

#

Even if it's possible to solve the puzzles without them.

vast jetty
#

Last year I had the experience of like

#

I’m solving a problem

#

I do it

#

I go on Reddit

#

I see people talking about BFS vs DFS

#

and they’re like DFS is better

#

I’m like ok guys wtf is that

#

They explain it properly, itbeing the great community it is

#

im like ā€˜oh so what I did’

#

Same with the flood fill

#

It does feel like you’re more lost if you have noooo vocabulary to talk abojt what you’re doing

#

And it def takes longer

#

But I don’t think it mattered all that much

bright spindle
#

Also, some DSA is less obvious than others. Sure, you might implement DFS intuitively, but you're probably not gonna reinvent A* by accident.

vast jetty
#

Those are really handy

naive wharf
#

I'm writing a small AoC utility library, any recommendations for things to add?
I already have the "set of ranges", and 2D maps of integers/characters

vast jetty
#

I def recommend grid support

naive wharf
vast jetty
#

Grid parsing?

#

Like for day 4

#

Hmmm what else

naive wharf
tender swallow
naive wharf
tender swallow
#

get with default on out-of-bounds is extremely useful IMO

#

also stuff for working with neighbors and directions

naive wharf
south musk
#

part 1 today seems too easy, I'm scared of what part 2's gonna be lol

south musk
#

day 5

#

today

#

I've solved part 1 now, part 2 doesn't seem that bad though

#

ok part 2 really can't be brute forced huh

hidden musk
#

just look at the ranges in the input lol

shy tulip
south musk
shy tulip
#

No for the bruteforce šŸ˜›

south musk
#

memory, idk off the top of my head but my bruteforce doesn't take much, time... Rest of the day technically but that seems stupid

bright spindle
#

I think it's normally the case with AoC that even if the bruteforce solution doesn't work (in a reasonable timeframe), there is usually a relatively simple non-bruteforce solution that doesn't require any advanced algorithms to implement.

cyan sleet
#

if this brute force is actually stepping through all of the ranges end of the day is a slight underestimate

white zealot
#

What do you guys mean by brute force?

cyan sleet
#

a naive solution

bright spindle
cyan sleet
#

the naive answer to "how many integers are in these ranges" of "go through all the integers and check if they are in a range" would be an example

bright spindle
#

Like, I dunno, finding primes by attempting to divide each integer with each smaller integer in turn.

shy tulip
#

Expand all ranges and count the unique numbers

cyan sleet
#

At least it's not death by old age that will get you in that case

#

unless you have a few petabytes of spare ram

shy tulip
#

It worked on the example input šŸ˜›

hidden musk
#

OS killed my script after about a minute. which was actually pretty surprising it took that long

hardy relic
#

I havent had time to do any aoc since day 2. I know I won't get stars but will it still tell me if the answers are correct?

magic oxide
#

you'll still get stars

#

there's no time limit on puzzles

#

you can go back and do past year's puzzles as well and get those stars

humble copper
hardy relic
#

oh ganksta

cyan sleet
humble copper
#

yeahhhh

rancid creek
#

there was also 2023/day5

frigid mural
rancid creek
hardy zenith
#

why is there a bot that keeps pinging me?

#

obviously the new puzzles are posted at midnight. the notification spam is annoying.

minor cave
mossy basin
#

you can also ignore the bot

humble copper
#

should i study for finals or do 2022 day 19

#

hmmmm

ripe meteor
#

have to catch up, got lazy yesterday

#

day 4 was pretty good

#

i hate grids

#

i spent some time troubleshooting and it turns out i padded the example and not the actual input šŸ’€

#

all my homies hate grids

low condor
#

definitely do finals instead

#

no good can come from doing that day first

low condor
ripe meteor
#

sounds like effort

low condor
#

way less effort than trying to deal with the problems that come afterwards

humble copper
#

i see why i gave up the first time

mossy basin
#
import numpy as np
low condor
#

it's a slog - but rewarding if you eventually solve it imo

potent jacinth
#

Tru

humble copper
#

a slow recursive solution actually worked for one line on the sample inputs.....

low condor
rapid wolf
#

I've had sample input correct answer wrong problems on every puzzle so far except day 1 IIRC.

shy tulip
#

Only today so far

#

And after seeing my mistake it was wild that the sample input worked

low condor
minor cave
#

Rouletters, I am undecided on a language or two to add to the roulette. This is your chance for requests!

vivid dove
lusty rover
#

You should be mean and do something like FORTAN or COBOL

low condor
buoyant perch
#

I started late. Yesterday actually. I’m just staring problem #4.

lusty rover
hollow wharf
#

I can suggest using racket

lusty rover
#

Haxe?

hollow wharf
#

Or that’s ur suggestion

lusty rover
cyan sleet
#

Some array language (Uiua/J/APL) could also be interesting, but might be too hard at this point

#

gnu bc is another weird-ass option
(yes, you can program in it, though idk if input parsing is doable, so might need some preprocessing)

#

there is R which I don't think we ever did

#

swift we never did I think

#

some sql

#

I wouldn't mind trying Odin

lusty rover
lusty rover
cyan sleet
#

it's been done

lusty rover
#

It has?

cyan sleet
#

last year

lusty rover
#

Oh

cyan sleet
#

(knowing Kat it will probably show up anyway)

lusty rover
cyan sleet
#

we've had that challenge twice šŸ™ƒ

lusty rover
#

When?

cyan sleet
#

twice

lusty rover
#

Man my steel trap must be falling apart

cyan sleet
#

in 2 years

lusty rover
#

IDR

#

Show your code

cyan sleet
minor cave
marsh currentBOT
#

day10/main.F90 line 1

module my_personal_aoc_hell```
cyan sleet
#

the order of languages this year has been kinda weird

#

ruby before crystal before perl feels so backwards

#

perl is proto ruby, crystal is almost ruby, ruby is

lusty rover
#

is what

cyan sleet
#

it just is

shy tulip
cyan sleet
#

octave isn't

rapid wolf
#

Flix could be interesting, tho it's mostly just a slightly cooked Haskell.

shy tulip
#

Mojo

lusty rover
shy tulip
lusty rover
#

Gotta love marketing

cyan sleet
#

I'm going to make myself a service and add a list of the languages to the readmes

#

oh fun, 2023 was the year I started using jj

humble copper
#

could anyone potentially give a hint for 2022 day 19 šŸ˜…

#

normal ||dfs|| takes way too long and i can’t think of any optimizations to put on top of it

cyan sleet
#

(I'm trying to remember the problem as I read my code :)

#

ah ok, so my upper bound thing is "what if I allowed doing all the actions at every turn"

#

and if the score from that isn't good enough I can just give up on this path

#

looking at some comments I did on the thread for that year

one pretty big optimization is that if you have enough robots of one kind, stop creating it

e.g. if you have more robots than you can even spend in one turn

ivory vigil
#

This is the comments in my code.

  • ||stop early if we haven't built enough geode robots to reach our goal before time limit (highest seen so far)||
  • ||stop early if we haven't built enough obsidian robots to reach our goal of geode robots before we need to switch to making only geode robots (as many as we need to hit our geode goal)||
  • ||didn't do the stop early's exactly, just close enough to ensure super dead branches weren't explored. some dead branches still got through but not very many (eg assume we have resources to make a geode bot each minute, assume that we'll have the full output of the obsidian miners in the whole 30 minutes at the time we start building geode bots)||
#

(2022/19 hints on optimizing)

cyan sleet
#

I'm trying to unbreak my 2022 rust code to see how big impact some optimizations had

#

so the solution I have is ~10ms, without the upper bound estimate for pruning
without it is took ~2s

#

so ~200x speedup

#

I also set my thing up so that my search options skipped forward in time, no clue if that matters much for performance

#

i.e. my options were like

  • If I wait, can I ever buy an geode bot? If so add the possibility of waiting until I can afford it and then buy it.
  • If I wait, can I ever buy an obsidian bot? If so add the possibility of waiting until I can afford it and then buy it.
  • ...
  • Do nothing, jump to the end time.
#

I can imagine that cut down on the number of states I had to process, but idk how key it was to have something fast

#

The simple upper bound simulation helped a ton though

#

Like, it's very easy to write. Just simulate and ignore the fact that you can only buy one thing per turn

#

That way you get no branching, and you get a cheap upper bound on the best score you could reach

#

(good lord I had a lot of untracked stuff in my git repo at the time)

feral hazel
#

once you solve it, i remember ||https://www.youtu.be/5rb0vvJ7NCY|| being a good video on the problem

optimization isn't always about multi-threading and optimizing hardware utilization. in fact, most performance work is about simply doing less.

tantan's video: https://youtu.be/jkHqrkcEHRc
philosophies of optimization (highly recommend): https://youtu.be/pgoetgxecw8
simple code high performance: https://youtu.be/Ge3aKEmZcqY

slides & code: http...

ā–¶ Play video
cyan sleet
#

mine is a tighter bound, but their is faster

hollow wharf
#

are you guys ready for AOC

#

tonight

half swan
#

hm I might do the roulette afterward

sullen adder
#

the halfway point already

shut trellisBOT
half swan
#

OMG the person saying trash chute was right

limpid grail
#

why am i jumping into the garbage chute 🄲

#

action packed decoration mission

#

can't even catch a break

#

oh hell naw šŸ’€

ivory vigil
#

Did anyone else's cookies expire?

pine tiger
#

holy string parsing

minor cave
# ivory vigil Did anyone else's cookies expire?

It depends on when you first logged into AoC after awhile this year. They should last ~4-6 weeks when they're freshly generated (which'll happen first time you visit the site after they expire/don't exist)

ivory vigil
#

I longed in 2 days before Dec 1 šŸ˜„

magic oxide
#

advent of parsing the input

#

šŸ’€

sullen adder
half swan
#

idek where I'm going wrong in p2

cyan sleet
#

@minor cave I'm impressed you managed to hit this task with C

ivory vigil
#

I didn't mind p2 too much

cyan sleet
#

in python?

ivory vigil
#

Yeah

cyan sleet
#

p2 is fine if I had sane string handling

#

but this is C

#

I'm in pain

minor cave
#

:)

half swan
#

(oops, forgot to hit reply, @cyan sleet )
hint: ||there is a consistent maximum amount of digits, both row-wise and column-wise, 4 for me, so if you wanted to you could waste a little bit of memory to make your life easier||

hidden musk
cyan sleet
#

I'm going to fix my input reading so I can actually run the same code for sample/input for p1 and p2

#

the number of lines differing between the cases is kinda cruel 😭

hidden musk
minor cave
#

I didn't, roulette language I pick is entirely vibe based plus inputs from friends who have no context

hidden musk
#

uh huh šŸ•µļø

cyan sleet
#

are we doing reverse language hardness this year?

half swan
cyan sleet
#

my lsp thinks I'm writing C++

magic oxide
#

oh god

#

i have to reparse the input for p2?

cyan sleet
#

:)

hidden musk
#

:)

cyan sleet
#

I should try to be not dumb and separate the bulk of the parsing from computation, huh?

magic oxide
#

my parser for p1 is 70 lines...

vast jetty
#

@hollow wharf hows it go

#

i did part1

#

im trying to write regex to parse part 2

#

(count everything until a space)

#

but its hard apparently

#

i could just write it in python hm

#

idk if i should

vast jetty
cyan sleet
#

imma leak memory, and nobody can stop me

vast jetty
#

oh never mind that doesnt even wwork anyway

#

alright then

feral hazel
#

got part 1 done in C
looks like i won't be pasting the code into the spoilers chat this time lol

#

sub 2k chars though

hidden musk
cyan sleet
#

my part 1 was <60 lines

#

but I'm rewriting everything now

vast jetty
#

part 1 is really short no

magic oxide
#

hahahaha

vast jetty
#

oh yall are not doing python?

feral hazel
#

oo i could do something really silly with a macro

feral hazel
vast jetty
#

hmm

#

thats better

#

im so lost

cyan sleet
vast jetty
#

i think i dont understand the problem

#

hm

magic oxide
vast jetty
#

the columns are separated by a single space?

#

the rest of the spaces are the left-right alignment?

#

how does one which space separates the columns in a given input

#

like

#

is it possible that we have overlap of columns or smth

minor cave
vast jetty
#

or there will always be one column (in the input) of just spaces, and thats the sepator?

#

idk its not hints i just dont understand this problem lol

vast jetty
minor cave
#

Part of advent of code is understanding the input, I don't want to unintentionally spoil this for someone who hasn't attempted it yet

vast jetty
#

huh i dont understand the puzzle text

#

oh well

#

lemme try fucking about a bit more and if i dont get it ill go to the channel

cyan sleet
#

brain pls

bool flag = false;
for (...) {
  if (cond) flag = false;
}
magic oxide
#

very new library function

buoyant perch
#

I had to fight my IDE to make it stop deleting trailing spaces lol

#

I’m finally caught up. Just finished Day 6

dense drum
#

lowk a fun problem

cyan sleet
#

ok, more general input parsing done

#

and p1 works still

#

now p2 should be a piece of cake

#

and done

vast jetty
#

fucking hell

#

so many for loops

#

and now i need MORE

#

sounds amazing

#

oh ffs why am i missing last col

#

alr minor fix

#

holy shit fuck me

half swan
#

I am once again getting correct answer for the example but not the actual input 😭

vast jetty
#

its so annoying

#

im done and i think today im not gonna spend much time cleaning up code

#

i lowkey never wanna see this again

potent jacinth
#

LOL why y'all pythoners complain about a few spaces?

vast jetty
potent jacinth
#

I haven't read it all. I want to express my sincere apologies for what I said.

vast jetty
#

which is absurd

#

usually it looks more wide

#

def not long

potent jacinth
#

My honest reaction.

vast jetty
#

its not horrible horrible

#

but its annoying

#

and also i didnt understand the problem text for the longest while

#

and thought i just need to ||find all characters until i hit a whitespace followed by a digit||

#

so i thought i can ||regex it||

#

until i realised i cant

#

like 30-40 minutess wasted?

#

hm

potent jacinth
#

Most sane Python developer be like.

magic oxide
dense osprey
#

i hate part 2

low condor
strange zinc
#

augh, p2 is a nightmare. the solving is good. the parsing...

low condor
#

The parsing IS the problem

vast jetty
#

indeed

strange zinc
#

finally done with it

hollow summit
#

cephalopod math is weird

low condor
#

Advent of Code is weird

#

Day 7 looks kinda interesting as well

#

like some kind of showroom for the Monty Hall problem

#

Is the car behind door number 1 or 2 or is it just a goat

magic oxide
#

you make a good point

#

i just noticed that day 5 is like a restaurant area

low condor
#

yes and Day 4 has the rolls of paper

magic oxide
#

which fits with the day 5 theme

low condor
#

Day 1 has the snowman

#

etc

#

it's how I guessed that day 6 would have us going down the chute

magic oxide
#

cool details

low condor
#

Day 2 has the lobby - Day 3 shows all the offline elevators

#

and I just realised Day 4 has the massive printer as well

#

and it really is a big printer - it's like the size of an elevator

half swan
#

or 2 or 1

low condor
#

it's 3 of something. will be interesting to see what

silent nymph
low condor
#

Could be a hallway of elevators

magic oxide
#

clearly it's this place
silksong spoilers

potent jacinth
#

Silksong sucks.

#

A rabbit possessed by Satan walking with a toothpick.

#

( I don't even know the gameplay )

hollow wharf
#

Of the game

#

šŸ’€ šŸ’€

potent jacinth
#

I think so.

#

Look at the pictures.

#

There is always that satanic creature.

hollow wharf
#

Def has a toothpick

vast jetty
#

shes on a quest to find the person who stole her carrots

potent jacinth
#

I have a few carrots in my fridge.

modern terrace
#

how interesting

bright spindle
naive wharf
#

yay, I got to use my charmap type today

#

I have a theory that it's gonna get a lot harder tomorrow

hollow wharf
#

part 2 had me thinking kinda more than last days

naive wharf
#

we made it through the first half

hollow wharf
#

or may be i was just having a bad day

hollow wharf
#

which haven't showed up yet

naive wharf
hollow wharf
#

peeps said its been like that every year

#

they is a transpose problem

naive wharf
naive wharf
#

there's also the obligatory flood fill puzzle

hollow wharf
#

flood fill!

ripe meteor
#

is Day 7 the filter? any bets

tender swallow
#

<@&831776746206265384>

worthy horizon
#

!cleanban @earnest bridge

marsh currentBOT
#

:incoming_envelope: :ok_hand: applied ban to @earnest bridge permanently.

ripe meteor
#

I didn't mean literally 😭😭

hidden musk
#

kalshi for aoc topics

hollow summit
#

language roulette was C, then Zig... tomorrow HAS to be rust

minor cave
#

:)

hidden musk
#

🤨

paper folio
#

so what puzzles do y'all solve when it's not December?

ivory vigil
paper folio
#

wow I'l definitely check those out!

ivory vigil
#

Everyone Codes is the closest to AoC

paper folio
#

Everybody codes? Everyone Codes seems like an IT course in Vienna

shut trellisBOT
waxen hound
#

Danke Robbin!!!

mortal bronze
#

Wow... I haven't even finished the day 5 -_-

limpid grail
#

who sees a teleportation pad and just steps on it like that 😭

tender swallow
#

ok this looks like a more interesting problem
nice

pine tiger
#

lowk choked but

#

allg

#

anyways

#

agnes tachnyon mentioned!!!!

covert arrow
#

aaaa I submitted the example input by accident

pine tiger
#

my condolences

lone nexus
#

this is interesting indeed

hollow wharf
#

its that time of the day

earnest forge
#

I don't understand how I'm meant to be counting beam splits disintegrate

lone nexus
#

12PM here lol

hollow wharf
#

12 am

hollow wharf
#

for me

pine tiger
lone nexus
#

12 hour difference eh

hollow wharf
lone nexus
earnest forge
#

Nvm I was double-counting lol

lone nexus
#

which yall should also agree

hollow wharf
#

we are literally 12 hrs apart then lmao

lone nexus
#

lmao

lone nexus
vast jetty
#

shit i woke up late

#

ill do this in like

#

half an hour maybe

hollow wharf
#

šŸ—æ

somber trench
#

is there a way to connect my program input directly to where the input is stored on the website?

earnest forge
#

God damnit I did basically P2 first

lone nexus
hollow wharf
#

or u can create one

vast jetty
#

write an html parser

vast jetty
hollow wharf
#

If i make an extension will you guys use it

vast jetty
#

my turn to oversleep

hollow wharf
vast jetty
#

i forgot my alarm

hollow wharf
#

alright imma read the problem statement now

lone nexus
#

šŸ’€

#

alr

#

aight

#

i'll do this later

vast jetty
#

the good thing is it doesnt look too bad

#

the bad thing is i have no concrete idea how to do it

pine tiger
#

||p1 is simulation, p2 is dp||

vast jetty
#

the other good thing is ill worry about it after i go brush and stuff

earnest forge
# vast jetty sure

There are a lot of libraries for that
From the top of my head, advent-of-code-data/aocd, aoc_helper (maintained by me), aoc_lube (maintained by salt-die)
I'm sure there are more

hollow wharf
#

I never did smth like this before

#

so this is gonna be fun and new

#

I understand the problem atleast now

covert arrow
humble copper
#

i was fooled

#

||naive recursion approach|| did not work, and neither did ||a list of all possibilities||

#

had to bring in 2021 methods for this šŸ˜…

feral hazel
#

does the hello world in https://ziglang.org/learn/samples/ work for any of you?
i'm getting error: root source file struct 'fs.File' has no member named 'stdout'

std.debug.print("hello world", .{}); works fine though

#

i'm on zig 0.14.1

paper folio
#

wow I got it done in 30 min!

vast jetty
#

whoops

sullen adder
hollow wharf
#

first or second

#

part

vast jetty
#

first

#

mate im writing code literally while brushinh

#

and getting my bed fixed and stuf

#

argh

sullen adder
#

multitasking pro

vast jetty
#

alright

vast jetty
hollow summit
#

oh my lord

#

is it yet ANOTHER recursion problem

tender swallow
#

||not necessarily||

vast jetty
#

its in the name

#

the rest of aoc is gonna recursively be recursive

#

im confused about how to implement p2

#

might go get breakfast and worry about it afterwards

hollow summit
#

im giving myself a stack to work with

#

because thats usually what i do for "recursive" problems

vast jetty
#

well

#

the good news is my solution works

#

the bad news is it takes fucking forever

#

lemme see if i can memoize without fucking up

#

alright

#

thanks @cache

#

EH

#

why was this so easy lol

feral hazel
magic oxide
#

yet another day of me forgetting about aoc

vast jetty
magic oxide
#

i got distracted theorem proving

vast jetty
#

math major?

magic oxide
#

math and cs

#

tho theorem proving is more CS related

#

as in automated proof checking

#

at least the thing i'm working on rn

#

i kinda don't feel like starting today's AoC before i finish work

tender swallow
#

finally solved 2024 day 21
nearly a year later

hollow summit
#

congrats, did the answer come to you in a dream or something

tender swallow
hollow summit
#

oh nice

warm berry
#

Yeah I am not doing part 2 today, this is not the weekend I learn pathfinding

hollow summit
warm berry
#

Even better!

hollow summit
#

the problem says you have to ||count all possible paths||

warm berry
#

And I do not understand a way to make that happen, so I'm going to move on

hollow summit
#

everytime the solution im thinking of involves ||recursion||... i tend to almost give up

tender swallow
#

last year I was going crazy ||trying to predict which move now would result in the best move 25 layers later by heuristics, by doing simulations up to some constant further layers, constructing each layer's move sequence based on that, and other nonsense||
instead I noticed that ||you can just write down the best move for each (from, to) pair for the dpad, and use that to just construct the best move for the next layer. this alone was an efficiency improvement, but still wasn't enough though since you'd run out of time and memory trying to construct the best move 25 layers out, so I used the same strategy I used for day 11, which is that we just need the length and not the sequence 25 layers out, and we can aggressively split on As to basically cache everything||

torn sapphire
#

honestly, not the worst day today, I just had a brainfart and thought the naiive way of doing part2 was actually the clever way

cyan sleet
torn sapphire
cyan sleet
#

||dynamic programming|| can be iterative pithink

torn sapphire
#

oh right, i thought ||you were just talking about making a recursive function that also uses a cache, that's just what my mind defaults to thinking dynamic programming always is :P||

warm berry
#

Yeah I don't know these terms

warm berry
#

I'm ok with not solving a day, I know I have a basic understanding of programming in general

cyan sleet
#

as a hint, you want to count the number of ways to arrive at any particular point

#

and counting doesn't actually require iterating over all paths

#

I think considering this basic case should be enough to give the overall idea

..S..
.....
..^..
.....
.^.^.
.....
#

annotated with counts
||```
..S.. 00100
..... 00100
..^.. 01010
..... 01010
.^.^. 10201
..... 10201

warm heron
#

Roulette language TeX when

dense osprey
#

beams cant be next to each other right?

peak dock
#

why not

dense osprey
#

ambiguity

#

but my input doesnt contain it anyways

vast jetty
#

i do wonder if theres a combinatorics approach

#

need to upgrade to pithon

magic oxide
#

welp

#

i procrastinated AoC way too much

#

guess i'll do it tmr

vast jetty
#

interesting

#

very interesting

magic oxide
#

was going to quickly do it today jumping off of last year's roulette code, but seems like zig has moved on and it's kinda late

vast jetty
#

and makes me feel dumb for not thinking of that

#

HMMM

#

so its like literally just ||2^n|| is it?

#

well it cant be

#

hm

#

oh i did think of that and went 'cant be'

#

but clearly there should be a combinatorics solution

naive wharf
#

when counting the tachyon splits, can I just count 'splitters hit by a beam'?

vast jetty
#

spoiler that

#

also sorry i thought you were talking about p2

tender swallow
# vast jetty huh

wouldn't that only work if the splitters were distributed in a regular geometric pattern?

vast jetty
#

yes

#

but i suppose there are subproblems to be had

#

or something

naive wharf
naive wharf
cyan sleet
hidden musk
#

me when it takes 30 minutes to figure out reading files

worthy horizon
#

!cleanban @vagrant bear scam

marsh currentBOT
#

:incoming_envelope: :ok_hand: applied ban to @vagrant bear permanently.

sharp elk
#

Am I the only one who's struggling with today's part 2?

tender swallow
sharp elk
sharp elk
low condor
tender swallow
low condor
#

Your approach, your algorithm

#

That is what needs to change

tender swallow
sharp elk
#

I'm not saying it's a language problem I'm saying I'm lazy to change the algorithms 🤣

tender swallow
#

the problem is that an algorithm too slow to solve this is going to be too slow in any language

#

just by the scale of the computation

low condor
#

I will say this - this kind of problem and the solution most go for is one of Advent of Code’s staple type of problems

#

You get one problem like this each year

#

FWIW I had to rewrite my Part 1 to Part 2

low condor
#

Not a huge rewrite but still

worthy horizon
#

Like switching from Bash to Rust

#

well... that might be 1000x

ivory vigil
#

I would defend bash... but you might be right.

worthy horizon
#

speaking of, did anyone solve day 4b using the most naive approach? (just doing exactly what the example walkthrough did, ||removing a bunch of paper on each iteration until you can't remove anything||)

tender swallow
#

if it's a combinatorial explosion like I assume is happening here, though, I doubt even Rust would save it

tender swallow
#

it was fast enough
I switched to a slightly more interesting approach later just for fun

worthy horizon
#

how long does it take in python approximately?

inland plank
#

I dont understand why the sample beam only splits 21 times
If I count the number of splitters ( ^ ) in the sample, I get 22 and not 21
What am I missing?

low condor
tender swallow
inland plank
#

Which one? Its so confusing looking at all the |'s all clumped up

sharp elk
inland plank
#

Is it the middle splitter in the 3rd splitter row from top?

low condor
sharp elk
#

Just had to change list to a dict

inland plank
#

gotcha

#

thanks I missed that

hidden musk
worthy horizon
#

mine was 2ms, so maybe my factors aren't too far off

#

same naive solution

#

(maybe you had a harder input though)

worthy horizon
sharp elk
#

My solution takes 2 ms

worthy horizon
#

it's a smart one though?

sharp elk
#

It doesn't even use any library

worthy horizon
sharp elk
#

I just used a dictionary to keep track of how many lasers are in a column

worthy horizon
#

oh, we're talking about day 4 part 2

sharp elk
worthy horizon
#

I haven't touched day 7 yet, I'll probably come back to the second half of AoC next year

sharp elk
#

my day 4 was 280 ms using the simplest approach I was lazy to make it faster

worthy horizon
#

using a different language also can mean different memory footprint, for example you can better make use of memory-speed tradeoffs i you can get very small integers

#

though Python does have array.array and numpy

sharp elk
#

Using numpy made it slower I was amazed ._.

worthy horizon
#

perhaps counterintuitively, getting an integer out of an array.array is slower than from a list. Because you have to construct a whole new int object based on the raw numebr

#

maybe it's the same thing with numpy, where you chat with it a lot instead of doing vectorized operations

bright spindle
sharp elk
bright spindle
#

But yeah, you never have to switch language for AoC

tender swallow
#

a castle, a flag, a ladder (?)

bright spindle
vast jetty
#

also isnt that day 5

vast jetty
#

nope its day 4

#

i just mistitled my post

bright spindle
vast jetty
void forge
#

I've been behind, I had other things to do and I was out so I only just completed day 4

naive wharf
#

tomorrow will be the floodfill problem
I feel it in my bones

mossy stream
#

Are we the only one who solved day 2 with regex? Lmao

naive wharf
tender swallow
#

it was faster certainly, but idk about easier

mossy stream
#

Generating all possible invalid IDs then checking against the ones in your input?

lime fulcrum
#

not quite all. more like all within a range

cyan sleet
woven solar
#

caught up on aoc 2025, maybe I'll actually do it this year

#

spent an embarassing amount of time on d1p2

low condor
lime fulcrum
#

so when do we think path finding day is coming up?

cyan sleet
#

the ux of that is horrible

low condor
cyan sleet
#

ah, that wasn't even an option when doing it on a spreadsheet

#

or at least idk how one would do the naive way

#

maybe it's possible with arrayformula pithink

low condor
#

For Python anyway

cyan sleet
#

right

low condor
#

Not sure about spreadsheets :)

cyan sleet
#

I just don't know how one would even express that in a spreadsheet

low condor
#

Fair enough - I have no clue either

naive wharf
#

Fingers crossed

ripe meteor
#

Keeping with tradition i think the hard day should be day 18 or maybe 22

#

<@&831776746206265384> (its a scam)

shy tulip
#

!compban 1447363591668764672

marsh currentBOT
#
Bad argument

Could not convert "user" into UnambiguousMember or UnambiguousUser.
User "1447363591668764672" not found.

wheat sapphire
shy tulip
#

!compban 1356942068177702922

marsh currentBOT
#

:incoming_envelope: :ok_hand: applied ban to @tribal frigate until <t:1765494463:f> (4 days).

hidden musk
ripe meteor
#

šŸ˜‰

hollow wharf
#

this time

ripe meteor
#

people missing my joke makes me sad

hollow wharf
#

😭 😭 😭 😭

hollow wharf
#

Didn u

ripe meteor
#

no i meant i hope they dont have hard days

hollow wharf
#

šŸ’€

#

Ts cooked

ivory vigil
#

I'm fine without puzzles that need z3 or hard parsing hundreds of lines of assembly. But I wouldn't mind a graph traversial or A* or whatnot.

hardy relic
#

this is from aoc 2015 - how can i count ALL targets in line - on line 20?

minor cave
#

Need to sleep so a helper needs to open spoiler thread. Good luck y'all

humble copper
#

i finally did 2022 day 19 part 1 after 3 years

#

🄲

hidden musk
humble copper
buoyant perch
#

5 minutes to go! Why am I nervous? lol

vast jetty
#

i hope not

#

or maybe i hope so

#

cuz i can handle that

buoyant perch
#

I've been doing fine until Day 7 and then the multi timeline thing just confused the heck out of me. I still don't understand how to count a "timeline".

vast jetty
#

im expecting another another 'naive approach takes 4 petabytes of space'

half swan
buoyant perch
#

It's funny how one little problem can destroy your confidence.

vast jetty
vast jetty
half swan
#

Think of it like a pinball machine where the pinball doesn't bounce back up

vast jetty
#

im surprised i could make it this far

vast jetty
#

one of those gaussian distribution thingys

#

i forgot hte name

buoyant perch
half swan
#

Ah yeah that had me stumped for a bit

#

the ||recursive|| solution is kind of intuitive but I challenged myself to do it without ||recursion||

#

Took a couple hours but I got it

#

That probably should've been spoilered a lil bit

paper folio
#

are ya excited

buoyant perch
#

Like I originally thought it was just 2^#numberOfSplitters. But that's way too high. And I finally understand, that when you choose a path above, that means some splitters below don't see that particular path, so it can't be 2^#numberOfSpillters

half swan
shut trellisBOT
buoyant perch
#

In each timeline, only one splitter at each level can be reached

vast jetty
#

oh fucking shit

half swan
vast jetty
#

alright

#

fuck it

#

im writing the naive approach first

dense drum
vast jetty
#

time for ||itertools.combinations|| again...

#

i hope thats good enugh fro part 1

#

i almost fell for it

pine tiger
#

oh wow, ||mst||

vast jetty
#

ffs

#

even the naive approach requires work

#

this might be the day i clock out

#

alright

#

good problem

#

im gonna take a whie

earnest forge
#

Off-by-one error cost me genuinely like 10 minutes disintegrate

#

I may be stupid

vast jetty
#

yall are done already

#

wow

earnest forge
hidden musk
#

||disjoint šŸ‘ set šŸ‘ union||

hardy relic
vast jetty
#

alr im so done

#

forget the problem

#

im fighting with fucking python rn

#

cuz i cant write a list comprehension apparently