Part 1
In this puzzle, we are given three operations and a list of room prices. We should first find the median price of the input and apply the operations in reverse.
The median price is found by first sorting the prices and then taking the element in the middle. For applying the operations, we can parse them via regex, since only a few templates are used
Part 2
In part 2, we should first sum all the even prices. Afterwards, we should apply the same operations again.
We can find the sum of the even numbers easily. The applying of the operations was done in the same manner as in part 1.
No comments:
Post a Comment