Skip to content

Instantly share code, notes, and snippets.

@arturohernandez10
Created January 30, 2026 19:32
Show Gist options
  • Select an option

  • Save arturohernandez10/6c75aefb0413800a67997241b01ec777 to your computer and use it in GitHub Desktop.

Select an option

Save arturohernandez10/6c75aefb0413800a67997241b01ec777 to your computer and use it in GitHub Desktop.
[2025 Day 12] Packing Challenge
[2025 Day 12] Packing Challenge
I believe the Elves asked me to pack the gifts (from the example of the problem) as densely as possible, no matter how many of each type. I found that 3x3, 4x4, 5x5, 8x8 and 9x9 squares allow optimal packing (that is, the remaining area is less than the area of any gift). But I think I've found a square that allows for the ideal packing (no empty area remaining)! K is en empty cell.
B B B G G R R R
B B G G G R R R
B B G C G C K R
P P P C C C Y Y
P P P C C Y Y Y
L L P A A Y U Y
L L L A A U U U
L L A A A U U U
optimal packings
K L L K
K L L L
A L L K
A A A K
A A A K
4x5 with 6 empty cells
B B B U U B B B
B B U U U B B K
B B K U U B B K
8x3 with 3 empty cells
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment