Copyright | (c) Eric Mertens 2021 |
---|---|
License | ISC |
Maintainer | emertens@gmail.com |
Safe Haskell | None |
Language | Haskell2010 |
Documentation
:: [(Integer, Integer, Integer, Integer)] | disc location, disc size, initial time, initial rotations |
-> Maybe Integer | time to press button |
Given a list of discs, find the right time to push the button.
Example:
Disc #1 has 5 positions; at time=0, it is at position 4. Disc #2 has 2 positions; at time=0, it is at position 1.
>>>
solve [(1, 5, 0, 4), (2, 2, 0, 1)]
Just 5