Safe Haskell | None |
---|
Day05
Description
General - Good one. Simple recursion problem. Take a range of N and binary walksearch it (lower, upper) until you findhit the element.
N / L U
A path has the range and the steps in it. A boarding pass has two pathes: A row path and a column path.
Right?
Wrong!
If you think about it for a sec (or have somebody tell you), you will realize that the boarding pass can be read as a binary number and that the seatId is that binary number.
Part 1 - Find the max of all seats ids.
Part 2 - Find the one seat ids that is not on the plane.