Copyright | (c) Eric Mertens 2021 |
---|---|
License | ISC |
Maintainer | emertens@gmail.com |
Safe Haskell | None |
Language | Haskell2010 |
https://adventofcode.com/2021/day/3
Select binary numbers using the most and least common bit in each position.
Documentation
fromBits :: [B] -> Integer Source #
Interpret list of bits as a big-endian binary number
>>>
fromBits [B1, B1, B0, B1]
13
pick2 :: ([B] -> B) -> [[B]] -> [B] Source #
Use selection function to filter entries by each bit column