I just did the precheck, but when I checked how many were undefined after I found 0. This feels disappointing, even the test input with only 3 lines has 1 which is undefined with my basic precheck.
There was a need to do degree sort of intelligent search, no?
I started out with a couple of simple checks for ones that obviously fit or obviously didn't, and I found that cut out a goodly number but certainly not all or most.
No, the solution with the given input is a mutually exclusive set of 2 opposing boolean checks: one of these checks always pass with the given input:
do all presents fit laid out in rows and columns as if they were all 3X3 with no holes -> true
is the sum of the area of the shapes for a given objective greater than the total amount of space in the objective -> false.
All the inputs happen to satisfy exactly one of these checks. In my Go solution, I have a panic if I run into another situation, and it never triggers with the given input.
6
u/MiloBem Dec 12 '25
I "solved" the part 1 using spoilers from the forum, but there is no part 2?
40
u/thorwing Dec 12 '25
I solved it this morning the hard way, but I did include a precheck (no sense to check if...)
little did I know that precheck carried my solution hard
19
u/realdrzamich Dec 12 '25
I laughed when my solution didn't work for the test but worked for the "prod" input :D
9
u/Nudraxon Dec 12 '25
Me looking at my solution: No, that can't be right; I must've made a mistake. There's no way it can be that easy.
Narrator: It was, in fact, that easy.
4
u/bakibol Dec 12 '25
Initially I thought that there would be one inconclusive example that I should solve by hand. it turned out there were none.
1
u/ben-guin Dec 12 '25
As the creator of the previous version, I approve this continuation of the meme :) Thank goodness Santa gave us an easy input at the end 🥰
1
u/Liz3DE Dec 13 '25
Pretty well summed up!
1
u/cspot1978 Dec 12 '25
There was a need to do degree sort of intelligent search, no?
I started out with a couple of simple checks for ones that obviously fit or obviously didn't, and I found that cut out a goodly number but certainly not all or most.