Main
Description
https://adventofcode.com/2017/day/2
main :: IO () Source #
checksum1 :: [Int] -> Int Source #
First checksum is the difference of the largest and smallest elements
>>> checksum1 [5,1,9,5] 8 >>> checksum1 [7,5,3] 4 >>> checksum1 [2,4,6,8] 6
>>>
checksum1 [5,1,9,5]
checksum1 [7,5,3]
checksum1 [2,4,6,8]
checksum2 :: [Int] -> Int Source #
Second checksum is the quotient of the only two elements that evenly divide each other.
>>> checksum2 [5,9,2,8] 4 >>> checksum2 [9,4,7,3] 3 >>> checksum2 [3,8,6,5] 2
checksum2 [5,9,2,8]
checksum2 [9,4,7,3]
checksum2 [3,8,6,5]