2025(05): part 1 is freshly done
This commit is contained in:
@ -43,3 +43,21 @@ The Elves are trying to determine which of the _available ingredient IDs_ are _f
|
||||
So, in this example, _`3`_ of the available ingredient IDs are fresh.
|
||||
|
||||
Process the database file from the new inventory management system. _How many of the available ingredient IDs are fresh?_
|
||||
|
||||
### Part Two
|
||||
|
||||
The Elves start bringing their spoiled inventory to the trash chute at the back of the kitchen.
|
||||
|
||||
So that they can stop bugging you when they get new inventory, the Elves would like to know _all_ of the IDs that the _fresh ingredient ID ranges_ consider to be _fresh_. An ingredient ID is still considered fresh if it is in any range.
|
||||
|
||||
Now, the second section of the database (the available ingredient IDs) is irrelevant. Here are the fresh ingredient ID ranges from the above example:
|
||||
|
||||
3-5
|
||||
10-14
|
||||
16-20
|
||||
12-18
|
||||
|
||||
|
||||
The ingredient IDs that these ranges consider to be fresh are `3`, `4`, `5`, `10`, `11`, `12`, `13`, `14`, `15`, `16`, `17`, `18`, `19`, and `20`. So, in this example, the fresh ingredient ID ranges consider a total of _`14`_ ingredient IDs to be fresh.
|
||||
|
||||
Process the database file again. _How many ingredient IDs are considered to be fresh according to the fresh ingredient ID ranges?_
|
||||
|
||||
Reference in New Issue
Block a user