Module day24

Source
Expand description

§It Hangs in the Balance

To simplify things assumes that the remaining items after the first best combination is found can be split evenly.

Sorts the weights in ascending order, then tries combinations of increasing size until a match in found. This will be the answer since the package count is the smallest and the quantum entaglement will also be the lowest.

Functions§

combinations 🔒
Check all combinations of size items returning None if no valid solution is found.
parse
part1
part2