Day 12: Christmas Tree Farm
Given the following type of input we are asked to parse the data and determine whether or not the presents could fit under the tree. First we are presented with present ids and shapes defined by "#". The final section describes each tree with the "widthxheight" specified followed by the present counts by id listed left to right. The first number is the count for index 0 and the second is the count for index 1 and so on.
0:
###
##.
##.
1:
###
##.
.##
2:
.##
###
##.
3:
##.
###
##.
4:
###
#..
###
5:
###
.#.
###
4x4: 0 0 0 0 2 0
12x5: 1 0 1 0 2 2
12x5: 1 0 1 0 3 2
Part 1
This puzzle seems more difficult than it actually is. The most work here was parsing each line as the solution did not actually require any tiling as was implied by description of the problem. If the area of the presents was greater than the area under the tree they would not fit and would need to be excluded from the count.
Once I got the parsing done I wasn't sure how to approach the next bit and scanned the subreddit where someone had just came out and said the total of the areas worked. I tried this approach and it indeed worked.
Now I have to go see if anyone found a solution that involved any tiling.
Part 2
There really isn't a part two for this puzzle.
This is day 2 of 100 Days To Offload.
Comments
This blog uses a Mastodon and webmentions for comments. You can comment by replying on Mastodon/ActivityPub/Fediverse account or webmention.