Live data from Hacker News

Day 20: My favourite problem from Advent of Code 2023

mliezun.github.io

1–10 of 49 posts

Re: Day 20: My favourite problem from Advent of Code 2023

#5
post #2

First I started by modelling the devices as objects. Starting with a single base class that has most of the common behaviour. Object oriented programming has ruined us

To expand on this: The issue is that OOP easily leads you to model your problem into your solution. This has the desired effect of solving the problem, but the likely undesired side effect that your solution encodes a specific problem description.

Thats why this is an issue

Re: Day 20: My favourite problem from Advent of Code 2023

#7
post #6

> But if we multiply the numbers together we get a number that is divisible by every number in the table. Wouldn’t LCM be the correct/more general approach? The periods could have common factors, right?

That's correct. In practice it appears that the AoC inputs provide numbers which are always co-prime (ie have no common factors other than 1).

Re: Day 20: My favourite problem from Advent of Code 2023

#9
I don't really like problems like these. I love Advent of Code and have got 50/50 stars on Christmas day this year -- but this type of problem grinds my gears.

The intended solution only works because the input is more constrained than what the problem statement says (the problem in full generality is PSPACE-hard). If you give me a problem to solve, I'd rather have all the hypotheses, all at once.

Post reply on HN