For the first part of day 6 we parse each word on each line as either
a number or as an operator (multiplication or addition). We then order
them all by column and calculate the final value once we have all
numbers and the operator.
Most of the work takes place in the parsing function, the rest is just
summing it all up.
We look at each valid (having coordinates inside the grid) neighbor to
a cell including a paper roll and then see if the neighbor contains a
roll of paper or not. Finally we count the number of rolls, if it is
less than 4 we can pick it.
The solution I went with is to walk the entire bank of batteries with
their joltages and pair them up. At every step I can either form an
incomplete candidate (Left x), or a complete candidate (Right (a, b))
if I already have a previous candidate.