Safe Haskell | None |
---|
Day09
Description
General - Get a/the list of numbers. Set the length of the preamble (P). Push a window of length P over the list and check the next number (by calcing the sum of pairs until we find a match).
Part 1 - Calc the pairs recursively.
Part 2 - Use part1 to find the invalidNumber and then (recursively) push a window over the input to find the encryption weakness.
Documentation
findEncryptionWeakness :: Int -> [Int] -> (Bool, [Int]) #
Return the encryption weakness.