okay, so this looks like bullshit

,,, looks at the input

oh, it's time to cheat 

https://codeberg.org/sugar700/advent-of-code-2025/src/branch/master/day12.zig

doesn't work for the example, but this sylveon doesn't care

genuinely curious, is this the intended solution??? fae is under assumption that it probably is, if the author of the puzzle would want to prevent people from cheating, he could do so easily

#AdventOfCode

Cookie monster!

@sugar This made me kinda curious what the puzzle was... (I'm not participating in Advent of Code.)

How does your solution work? I don't know zig and I don't have it in me to decipher it at the moment. It just looks amazingly short for how complex the puzzle seems.

@rgbunny okay, so the puzzle is about determining whether given shapes fit within a rectangle, the shapes can be flipped, rotated, whatever

this would be really difficult to do, but, there is a trick to the puzzle, for instance, in faer input, the first line is as follows

50x39: 42 56 53 50 49 51

the shapes to fit in the input are respectively made out of: 7, 7, 5, 6, 7, 7 squares

so, let's do the math

42*7 + 56*7 + 53*5 + 50*6 + 49*7 + 51*7 = 1951
50 * 39 = 1950

no matter how optimally the pieces are placed, they won't fit

and when you look through the entire input, every single line in the input either clearly won't fit, or will clearly fit with plenty of room remaining

@sugar Ohhhh

I did figure a quick way to eliminate certain inputs would be to check the sum of the squares, but I figured there could be inputs where the sum would theoretically fit, but the geometry wouldn't allow it.

But if it's giving tons of extra space for the valid inputs, then I suppose it's pretty unlikely for the geometry to prevent it from becoming invalid.

@rgbunny @sugar

that's interesting.. I had a check to see if the sum of spaces required was too large and to early return false, but due to the example though that couldn't be relied upon. If I add a check to see if ANY placement (the full 9 squares) works, that also is true for all my input lines.

@sugar what shapes did your input have?

@unnick

0:
.##
##.
###

1:
#.#
#.#
###

2:
##.
.##
..#

3:
..#
.##
###

4:
###
.##
.##

5:
###
.#.
###